|
|
|
Charles Meyer
Community Member
|
|
I get the following error when I compile my code:
ERROR in C:\Program Files (x86)\PostSharp 1.5\PostSharp-1.5.targets(261,5) : Unhandled exception: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. at System.ModuleHandle.ResolveMethod(Int32 methodToken, RuntimeTypeHandle* typeInstArgs, Int32 typeInstCount, RuntimeTypeHandle* methodInstArgs, Int32 methodInstCount) at System.ModuleHandle.ResolveMethodHandle(Int32 methodToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) at System.Reflection.Module.ResolveMethod(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) at PostSharp.CodeModel.MethodDefDeclaration.GetSystemMethod(Type[] genericTypeArguments, Type[] genericMethodArguments, BindingOptions bindingOptions) at PostSharp.Laos.Weaver.MethodLevelAspectWeaver.Initialize() at PostSharp.Laos.Weaver.OnMethodBoundaryAspectWeaver.Initialize() at PostSharp.Laos.Weaver.LaosTask.Execute() at PostSharp.Extensibility.Project.ExecutePhase(String phase) at PostSharp.Extensibility.Project.Execute() at PostSharp.Extensibility.PostSharpObject.ExecuteProjects() at PostSharp.Extensibility.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation) at PostSharp.MSBuild.PostSharpRemoteTask.Execute(PostSharpTaskParameters parameters, TaskLoggingHelper log)
This is a web application project and using Visual Studio 2008 via the command line tool (build script). The build system is running Windows 2008 (64 bit). Any thoughts?
*** UPDATE***
This appears to only happen if the compilation is done via MSBuild, but if built using Visual Studio, it works fine.
|
|
|
|
|
Gael Fraiteur
SharpCrafters
|
|
That's really weird. Never seen that in 5 years.
I suspect you're running PostSharp from a non-trusted location (such as a network share). Is it possible?
-gael
|
|
|
|
|
Charles Meyer
Community Member
|
|
No, we are NOT executing it from a network share. We are running it through MSBuild via Team Foundation Server build process on a Windows 2008 64 bit server. It doesn't make sense, because if I open the project on that same server and build it via the IDE, it builds fine, without any errors/warnings. Also, it only does this when it is building a Web Application project. If I build a class library project, it works fine.
Weird, huh?
|
|
|
|
|
Gael Fraiteur
SharpCrafters
|
|
|
What if you force PostSharp to run out-of-process by defining the MSBuild property "PostSharpUseCommandLine=True" in your project?
|
|
|
|