Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use aspnet_compiler

Afterlooking at this [post][1], I thought that I would give it a go.

So, in my Post Build Event, I've put...

C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler -v / -p "$(ProjectDir)\"

...then clicked Build Solution.

Unfortunately, I got the following error: "Could not load type 'MyWebProject.UI.Global'. C:\global.asax 1 MyWebProject.UI"

Any ideas why? To my knowledge, I don't even have a C:\global.asax file.

Ultimately, I want to be able to check my ASPX pages for errors. At the moment, the only way in which I can do this is by navigating to the page.

Any other suggestions/approaches welcome!

Thanks,

ETFairfax

like image 514
ETFairfax Avatar asked Jun 02 '26 01:06

ETFairfax


2 Answers

http://mikehadlow.blogspot.com/2008/05/compiling-aspx-templates-using.html

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v / -p "website complete path" d:\testPrecompileFolder -f

like image 101
Muhammad Mubashir Avatar answered Jun 03 '26 13:06

Muhammad Mubashir


Your post build event is pointless. If you can precompile, then you don't have any errors that aspnet_compiler would catch anyway. Runtime errors are another matter of course.

like image 40
Bryan Avatar answered Jun 03 '26 13:06

Bryan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!