Sometimes by using of ASP.NET_compiler following error can occur:
error ASPCONFIG: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
After deep investigation, I found very simple solution. The problem is that the error message is just badly designed.
It seems that this error is caused by the argument with the parameter –v, which specifies the virtual directory.
Here is an example:
aspnet_compiler.exe" -c -d -v /MyWebApplication -p
D:\\MyProjects\\MyWebApplication -f D:\\DestinationFolder
Usualy, the folder D:\\MyProjects\\MyWebApplication is the folder which contains the solution file MyWebApplication.sln.
However the argument –v has to specify the folder which contains the web application and not the solution file, as shown in the following example:
aspnet_compiler.exe" -c -d -v /MyWebApplication -p
D:\\MyProjects\\MyWebApplication\\MyWebApplication -f D:\\DestinationFolder
Posted
Oct 25 2006, 08:48 AM
by
Damir Dobric