Question

I try to compile my web project with aspnet_compiler.

aspnet_compiler -f -fixednames -u -v / -p C:\test\testproj\testproj c:\test\output -c

The testproj is a web site that has a dependency to a class library called MyLib.

The problem is that aspnet_compiler only compiles the web site and not the class library MyLib. So whenever I make changes to the class library I have to either manually build the MyLib using msbuild and copy the .dll. Or rebuild the solution in visual studio.

How can I make aspnet_compiler rebuild all referenced projects?

Was it helpful?

Solution

Unfortunately the aspnet_compiler cannot build any of the project dependencies of your web site. To do this, there are a couple of options available to you:

If you are using Visual Studio 2005 or 2008, create a Web Deployment project (first you'll need to download and install these from http://www.microsoft.com/downloads/en/details.aspx?FamilyID=0AA30AE8-C73B-4BDD-BB1B-FE697256C459) and then use MSBUILD.EXE to compile your web site and all of its dependencies:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\MSBUILD C:\test\testproj\testproj.wdproj /target:Clean;Rebuild

If you are using Visual Studio 2010, you can migrate your web site to an ASP.NET Web Application project which uses a .csproj file that can be compiled with MSBUILD (no additional downloads required):

C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBUILD C:\test\testproj\testproj.csproj /target:Rebuild;Package
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top