views:

2016

answers:

5

I am unable to build my Web Application (not Web Site) in our build environement. We use DMAKE in our build environment (this unfortunately is non negotiable, therefore using MSBUILD is not permitted ) and when invoking the asp.net precompiler through

C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler -d -nologo -p Site -f -fixednames -errorstack -v / Debug

We get the following error

error ASPPARSE: Could not load type 'X.Y.Admin.Site.Global

If I compile from the ide it is successful. If i then compile with aspnet_compilier it is successful. So i only get a successful compile with aspnet_compiler when the target dll i am trying to compile is in the bin of the web application i am compiling.

I keep running into postings that talk about solutions using MSBUILD which unfortunately I cant try.

Any help would be appreciated

A: 

Have you tried specifying the path using -p? Sounds to me like it can't find that type / assembly.

http://msdn.microsoft.com/en-us/library/ms229863(VS.80).aspx

pbz
A: 

For web applications, you have to build the .vb files into a dll and put that in the bin folder before you run the aspnet compiler. Check the output window in visual studio and you'll see the command line for the VB compiler. Run that first before you run the aspnet compiler, and the asp pages should be able to find the missing types.

Sean McMillan
+2  A: 

I ran into a similar problem using NANT. The trick was to compile the web applications code files into a dll then include that when using aspnet_compiler.

use the command line compiler,either csc.exe (c#) or vbc.exe (visual basic), to compile your web application with an output of type library. This will create a dll that you can use in your aspnet_compiler task

hansolosuperstar
I was under the mistaken impression that aspnet_compiler also compiled the web application and created the dll. (the words asp and compiler made me think this!)
AndyM
+1 for this answer, it worked for me as well (thank goodness!). What on earth did we do before StackOverflow? :-)
gerrod
A: 

I received the same problem.

I fixed it by copying my webapp's DLL from the OBJ/DEBUG folder to the BIN folder.

Casey Burns
+3  A: 

We had the same problem on our web application: error ASPPARSE: Could not load type '...'

The problem was that we had the file on disk (on the project folder) but it wasn't included in our application project (in the .csproj file). We solved the problem by including the file in the project :)

costin

related questions