SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created a custom Central Admin .aspx page that inherits from the OperationsPage base class, which is defined in Microsoft.SharePoint.ApplicationPages.Administration.dll. Naturally, I added a reference to that assembly to my project. That particular assembly is not in the GAC, but rather, is located in the C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\CONFIG\ADMINBIN directory.

So I can deploy my page and run it, and all is well. The trouble comes when I try to load my assembly (the one that references Microsoft.SharePoint.Application.Administration.dll) using Assembly.Load(). The runtime complains that it can't locate the Microsoft.SharePoint.ApplicationPages.Administration.dll assembly (technically, it doesn't complain until I call GetTypes() on the assembly after it's been loaded).

I thought maybe if I tried to load that assembly into memory first using Assembly.LoadFile(path), and passing in the absolute path to the assembly (mentioned above), then maybe .NET would be able to find it later when my assembly gets loaded. Unfortunately, the call to Assembly.LoadFile(path) throws an exception with the message "Failed to grant permission to execute".

Anybody have any thoughts?

share|improve this question

closed as too localized by Alex Angas Jun 4 '11 at 6:14

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.