Tuesday, April 25, 2017

Compiling asp.net 3.5 manually

I have a ASP.Net web project that was done in VS2010 and now I want to publish it with VS2015. Then, the compiler complained that there are many compilation errors such as CS0117 (method or extension method not found) and CS0246 (type or namespace not found). After hours of research on the web, still cannot find any solution to have VS2015 to publish the ASP.net 3.5 project.

Finally, I decided not to use VS2015 to publish the old project. Instead using command line to publish it even though the steps are a bit lengthy.

Here is the steps:

1. Run VS2015 and open the ASP.net 3.5 web project.
2. Choose Release mode.
3. Choose Rebuild Solution.
4. Upon rebuild done, copy the entire website folder into "d:\manual-compile" folder (or whichever folder that you like).
5. Then, run the following command in command prompt:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v /website1 -p d:\manual-compile\website1 -u -fixednames d:\manual-compile\website1-compiled


Wait for a while and you will see the precompiled version of ASP.net appeared in "d:\manual-compile\website1-compiled" folder. There you go.


No comments:

Post a Comment