Reputation: 372
Im having a WebApplication that runs in vs2010 but the target framework is set as 2.0. The application uses enterprise library. when I execute the application in my local I getting an error
Required permissions cannot be acquired.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Security.Policy.PolicyException: Required permissions cannot be acquired.
and in the stack trace I'm getting error
FileLoadException: Could not load file or assembly 'Microsoft.Practices.ObjectBuilder, Version=1.0.51205.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
If is set the target framework as 4.0 the code executes fine. I have tried the following steps :
set the 'Copy to output directory' in the objectbuilder dll property as copy always (earlier it was do not copy)
tried adding the trust tag with trust level="high" originUrl="" and also trust level="low" originUrl=""
copied the below tags from the machine.config of 4.0 to machine.config of 2.0
section name="fullTrustAssemblies" type="System.Web.Configuration.FullTrustAssembliesSection, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
section name="partialTrustVisibleAssemblies" type="System.Web.Configuration.PartialTrustVisibleAssembliesSection, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication"/>
but still getting the error. Please let me know what could be the issue..
Upvotes: 0
Views: 2241
Reputation: 372
prob solved.. i took the EL dlls seperately, gave it strong name & registered the assembly in GAC.. and now the code works fine..
Upvotes: 0