AspNetCompiler: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v /PreCompiledWeb -p "Web Sites\Campaigns\\" -u -f -d PreCompiledWeb\
AspNetCompiler: : ERROR /PreCompiledWeb/Controls/SignInOptions.ascx(4,0): Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Finished Task AspNetCompilerDone executing task "AspNetCompiler" -- FAILED.
We've added the following security attributes to the offending control - but this has not fixed the error.
[
AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Unrestricted)][
AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Unrestricted)]Any help would be greatly appreciated.

ASPNETCompiler Error - System.Web.AspNetHostingPermission, System
DW5000
Thank you for taking the time to respond to our post.
We are using Visual Studio 2005 Team Suite Trial Version.
VS 2005 Version 8.0.50727.42
.NET Framework Version 2.0.50727
1. Note that we do not have this error when we run aspnet_compiler dircectly from the command line against our source code. We only get this error when aspnet_compiler runs from within our MSBuild script. (The parameters passed to aspnet_compiler are exactly the same)
below is from our build script -- we are using the built-in MSBuild task and passing our solution file to the task. Therefore, in order to add -errorstak when calling aspnet_compiler I will have to go muck with one of the target files that ships with Visual Studio. I will try this and post the stack trace if I can get it.
<!--
Compile Code --> <Target Name="Build"><
MSBuild Projects="$(BuildFolder)\Foo.Company.Marketing.sln" /><
OnError ExecuteTargets="ReportFailure"/></
Target>2. There is no other trust level set underneath the machine level. We are not trying to intentionally run the app under partial trust. The trust level is set to Full at the machine level.
3. The referenced dll is in the bin and we have signed it with a strong name (but we only signed it after we encountered this problem thinking that it might fix it which it did not)
4. Yes the user control is working fine in the source application.
This is a very basic app.
briggins5
Can you please let me know what problems you had creating an account on the ASP.NET forums You can send me an email at plepage@microsoft.com.
I'll get someone to answer your question asap!
PEte
MikaelN
Neil
Macrap
We were running our build process in a UNC share. I used the .NET Framework Configuration Tool to grant FullTrust permission to this share and now everything works just fine.
Kishan Sanji
Kjell Arne
I'll forward this thread to our internal ASP.NET customer response team and hopefully someone can jump in. In the mean time do try and post over at forums.asp.net. They have a special forum just for Visual Studio 2005 integration discussion.
Neil
Maciej Boniecki
What is interesting is that if we simply run aspnet_compiler against the same source folder from the command line (with the exact same parameters that the MSBuild script generates) there are no errors. This error only occurs when we run the MSBuild script.
We believe that the security policy is set up correctly on the build server and that we shouldn't be experiencing this security problem.
RobertNet
Hello mtobin & Qing
I'm getting the same error, but I haven't found how to grant fulltrust to a share. I've just succeded in granting permission levels to assemblies. When I try to set it to a share it tells me that it can't load the assembly.
Should I grant the fulltrust permission to the dlls used by my web pages or something like that
Sorry my unknowledge about security. I'm getting on it nowadays.
Thank you in advance
SFdesign
Will Pearson - MVP
Hi mtobin,
I'm from ASP.Net team in Microsoft. Have some questions to drill down the issue:
1. Would you show us the stack for the error You may use -errorstack when calling aspnet_compiler.
2. Is there any trust level set under machine level Are you intentionally want to run the app under partial trust
3. Where is the referenced dll GAC or bin If none of these, how do you set up binding
4. Is this particular usercontrol working in the source application before precompilation
Thanks,
Qing
Ensign Joe
Excellent! Please let us know if you run into other issues. Use http://forums.asp.net/ will get a faster response.
Thanks!
aruyp
misterEd
Thanks!
katrien