Differences in build by Visual Sudio and by MSBuild

Oct 14, 2013 at 6:01 AM

Today I've run into the following problem:
I converted my project to use RazorGenerator.MSBuild.
When I run build from Visual Studio all works fine. Generated files contain all namespaces from Web.config file located in my 'Views' folder as well as correct base type is used for my views.

But when I tried to build from command line by MSBuild I got tons of errors. I looked into generated code and found that neither my imports nor base type are used. I can see standard imports and System.Web.Mvc.WebViewPage<T> as base type instead.

It seems that Web.config file in last case is completely ignored. Can you help me to resolve this issue? (I use RazorGenerator.MSBuild.2.1.6)
Oct 14, 2013 at 11:19 AM
I found the following:

1) Build fails both on Visual Studio and msbuild in case I buld my solution FIRST time (no bin\obj folders nowhere)
2) Build also works both on Visual Studio and msbuild SECOND time in case I remove content from obj\CodeGen\Views\Report folder that actually contain all my views as well as Web.config with imports and base type defined. On second build (*.cs) files for views are generated again but this time they have proper imports and base type.

Can anyone explain why this could happen?