0

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?

1 Answer 1

1

I managed to fix the problem using the following steps:

  • remove reference to the library containing the model
  • clean project
  • close VS
  • reopen VS
  • rebuild project (VS throws errors)
  • re-add reference to the model library
  • rebuild project

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.