简体   繁体   中英

Publishing web apps and websites

I understand that references are stored in the project (vbproj) file for ASP.NET web applications and the Web.Config ( http://msdn.microsoft.com/en-us/library/37e2zyhb%28v=vs.71%29.aspx ) for websites.

I have recently converted a website into a web application. I notice now that the web application will publish (using the Publish option) even if the version information is incorrect in the Web.Config, then when accessing the web application through a browser I get an error.

I was unable to Publish a website if the version of an assembly in the Web.Config was incorrect.

I read that web applications are precompiled (before publish) whereas websites are compiled the first time the website is accessed through a browser.

Therefore, I believe what I have said should be the other way around ie I should be able to publish websites with an incorrect version in the Web.Config (because they are not compiled) and I should not be able to publish a web application.

What am I missing?

After some further research; I have discovered that ASP.NET web applications are built using MSBuild and ASP.NET websites are built using ASPnet_Compiler. ASPnet_Compiler looks in the Web.Config for referenced assemblies (add assembly tag) at build time, whereas MSBuild looks in the project file (vbproj) at build time.

Web applications are deployed without the vbproj. I believe the project file is used for linking. Therefore at runtime a web application uses the information in the Web.Config to identify assemblies to look for in the local bin folder and then the GAC (for aspx pages only)ie namesapces still have to be manually imported into the code behind partial classes.

If anyone has any comments or better answer then please post.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM