When using ASP.NET MVC to build a website and using web activator, you may run into a problem during the building of your project (especially when BuildMvcViews is turned on) or when writing your views: exception might look like this:
The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Exception has been thrown by the target of an invocation...
In order to debug it, run the following code in command line:
aspnet_compiler.exe -errorstack -p C:\physical\path\to\MyApp -v MyApp
Check the exception details for possible solutions.
The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Exception has been thrown by the target of an invocation...
In order to debug it, run the following code in command line:
aspnet_compiler.exe -errorstack -p C:\physical\path\to\MyApp -v MyApp
Check the exception details for possible solutions.
Another issue with the BuildMvcViews turned on is this: you may see the following error:
Unrecognized attribute 'xmlns:xdt'. Note that attribute names are case-sensitive..
The easy workaround is to delete the contents of the obj folder of the failing project and then rebuild your solution. Second workaround is to add the following command to your project's pre-build commands:
del "$(ProjectDir)obj\*" /F /S /Q
Note the quotation marks in a command, they are needed if your project path contains spaces.
Unrecognized attribute 'xmlns:xdt'. Note that attribute names are case-sensitive..
The easy workaround is to delete the contents of the obj folder of the failing project and then rebuild your solution. Second workaround is to add the following command to your project's pre-build commands:
del "$(ProjectDir)obj\*" /F /S /Q
Note the quotation marks in a command, they are needed if your project path contains spaces.