The problem was in the name of the website.. since it was an IIS website hence the name of the website was
http://xx.xx.xx.xx/mywebsite.
I suspect the "://" in the name was the problem and since its not a valid name for creating a folder or file in Temporary Files in IIS, the compilation lock was throwing error.
I removed it as IIS website and changed it to File System website. Since now the name doesnt have any "://" it builds and runs as expected.
ashishlive
Member
26 Points
5 Posts
Build (web): The type initializer for 'System.Web.Compilation.CompilationLock' threw an exception...
Nov 15, 2012 02:41 AM|LINK
Hi all,
I am building an MVC3 application in VS2010. When I build it, it throws an error saying
"The type initializer for 'System.Web.Compilation.CompilationLock' threw an exception"
I am running VS in elevated privileges.
The code is placed in IIS.
I have tried iisreset, aspnet_reg but to no avail. I am unable to find what is causing this error.
Help is appreciated
Thanks
Ashish
ashishlive
Member
26 Points
5 Posts
Re: Build (web): The type initializer for 'System.Web.Compilation.CompilationLock' threw an excep...
Nov 16, 2012 01:28 AM|LINK
Finally, I found the solution myself.
The problem was in the name of the website.. since it was an IIS website hence the name of the website was http://xx.xx.xx.xx/mywebsite.
I suspect the "://" in the name was the problem and since its not a valid name for creating a folder or file in Temporary Files in IIS, the compilation lock was throwing error.
I removed it as IIS website and changed it to File System website. Since now the name doesnt have any "://" it builds and runs as expected.
Any views or queries are welcome
Cheers... Ashish :)
Angie xu - M...
All-Star
20211 Points
1710 Posts
Microsoft
Re: Build (web): The type initializer for 'System.Web.Compilation.CompilationLock' threw an excep...
Nov 16, 2012 03:55 AM|LINK
Hi ashishlive
Glad that you've solved your problem by yourself and I come here to confirm and close the issue.
If you have anything urgent, please feedback by creating another issue.
Regards
Feedback to us
Develop and promote your apps in Windows Store