This project is read-only.

Namespace not added to generated views

Oct 1, 2014 at 4:28 PM
Hello,

First of all, great work! I really like your tool and it makes unit testing of views a breeze!

I would really appreciate if you can help me with following issue,. I know this has been reported earlier but i constantly have problems with namespace in web.config in Views folders not being added to generated views. I am using the latest version of MVC, version 5.2.2.0 and the view namespaces are not getting added. To reproduce my problem, just create a new project with latest MVC version from nuget and you should be able to see it.

Your help is greatly appreciated. Btw i am using version 2.0.0.0 of RazorGenerator.Mvc that i got from Nuget.

Thanks!
Oct 2, 2014 at 1:20 AM
This thread discusses the issue. Short summary is that we have not been able to repro it ourselves, and that for those who see it, it seems to come and go. We really need to identify the trigger.
Oct 3, 2014 at 10:11 PM
Thanks for the reply. In my case i was able to figure out what caused this issue.

For some reason, the project file had version set to 4.0.0.0 for mvc version 5.2.2.0.
I deleted MVC nuget package versions from solution and re-installed MVC. This corrected the version number in the project file and since then the namespaces in web.config were correctly copied to generated files.
Oct 4, 2014 at 1:43 AM
Great, thanks for sharing! That might help someone later.

Clearly, the detection is on the fragile side...