Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using the ASP Compiler in NAnt to build an ASP .Net MVC application

I am succesfully building ASP .Net applications in NAnt using the ASP Compiler, without a problem., as part of my Continuous Integration process.

However, if I try exactly the same process on an ASP .NET MVC application, the build fails in NAnt, but will compile succesfully in Visual Studio. The error message I get in NAnt is:

[HttpParseException]: Could not load type 'MyNamespace.Views.Home.Index'

which appears that it has a problem with the dots in the filenames, but I might be wrong.

Any suggestions are most welcome.

like image 707
Brett Rigby Avatar asked Dec 22 '22 09:12

Brett Rigby


1 Answers

You shouldn't install ASP.NET MVC onto the build box. You should be referencing the System.Web.MVC, System.Web.Routing and System.Web.Abstractions DLLs from wherever you store your third-party references. We normally have a /lib folder for all references where we have those 3 DLLs (and many more) stored and a /src folder where all of our code lives. If you are referencing these DLLs this way, you no longer have to rely on the environment for those DLLs. This blog post explains this idea in more detail.

like image 128
J.R. Garcia Avatar answered Dec 26 '22 07:12

J.R. Garcia