I'm using Visual Studio 2010 SP1, ASP.NET MVC 3 + tools update. When I try to add a strongly typed razor view to a controller action, VS throws an error "the templates had the following 1 error(s) when running: "
The 'ReferencedAssemblies' property cannot contain null or empty strings.
Parameter name: options
at Microsoft.VisualBasic.VBCodeGenerator.CmdArgsFromParameters(CompilerParameters options)
...
I have tried to 'clean' the project, shut down VS, reopen VS, rebuild, but I still got the same error.
Only 'empty' scaffold template works. List, details, edit, etc throw the same error.
Anybody has a solution for the error?
I managed to fix the problem using the following steps:
After that, VS can successfully build the view.
EDIT
I noticed that in the process of doing the steps above, I also closed git bash console that was open on the project folder. I tried just closing the git shell, and I became able to generate views without doing the steps above. Looks like the git shell locks some files, and this causes the error when generating views.