How to deploy new assemblies in an ASP.NET 2.0 application?
-
I have a number of ASP.NET applications that I have converted from ASP.NET 1.1.4322 to ASP.NET 2.0 and am finding that making updates to them now seems considerably more painful than it was under 1.1.4322. They have ASPX pages with no code behind at all (or any other classes and code other than the Assembly.cs file) inheriting from a shared WEB UI assembly via page attributes: <%@ Page Inherits="MyCompany.MyProduct.WebUI.PageName" %> Previously if I wanted to update the WebUI assembly all I did was copy the new assembly to the server, register it in the GAC then do a search and replace to change all references to the MyCompany.MyProduct.WebUI.PageName in the web config file (for HTTP Handlers, HTTP Modules and in the configuration/system.web/compilation/assemblies section) to reflect the new version number of the assembly. However I tried to do this to an ASP.NET 2.0 application and got an error about an ambiguous reference at the <%@ Page Inherits="MyCompany.MyProduct.WebUI.PageName" %> line. (it stated it could be either MyCompany.MyProduct.WebUI.PageName 1.0.0.0 or MyCompany.MyProduct.WebUI.PageName 1.0.0.1 Is there any other thing I need to do to get it to forget about the old assembly and just use the new one as defined in the web.config?
-
I have a number of ASP.NET applications that I have converted from ASP.NET 1.1.4322 to ASP.NET 2.0 and am finding that making updates to them now seems considerably more painful than it was under 1.1.4322. They have ASPX pages with no code behind at all (or any other classes and code other than the Assembly.cs file) inheriting from a shared WEB UI assembly via page attributes: <%@ Page Inherits="MyCompany.MyProduct.WebUI.PageName" %> Previously if I wanted to update the WebUI assembly all I did was copy the new assembly to the server, register it in the GAC then do a search and replace to change all references to the MyCompany.MyProduct.WebUI.PageName in the web config file (for HTTP Handlers, HTTP Modules and in the configuration/system.web/compilation/assemblies section) to reflect the new version number of the assembly. However I tried to do this to an ASP.NET 2.0 application and got an error about an ambiguous reference at the <%@ Page Inherits="MyCompany.MyProduct.WebUI.PageName" %> line. (it stated it could be either MyCompany.MyProduct.WebUI.PageName 1.0.0.0 or MyCompany.MyProduct.WebUI.PageName 1.0.0.1 Is there any other thing I need to do to get it to forget about the old assembly and just use the new one as defined in the web.config?
Could you post what your configuration/system.web/compilation/assemblies node looks like? I created two version of the an assembly called PageLibrary (ver 1.0.0.0 and ver 1.0.0.1) and added them to the GAC. Then within the web.config, I added version 1.0.0.0 to the assemblies node and the application worked fine. Then I changed the version number to 1.0.0.1 and everything worked fine. Are you listing both assemblies version under the assemblies node? (Are you doing this?) <compilation debug="true"> <assemblies> <add assembly="PageLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bdc533f43df02cbe"/> <add assembly="PageLibrary, Version=1.0.0.1, Culture=neutral, PublicKeyToken=bdc533f43df02cbe"/> </assemblies> </compilation> The more we know, the easier it will be to help you out. ~Javier Lozano
-
Could you post what your configuration/system.web/compilation/assemblies node looks like? I created two version of the an assembly called PageLibrary (ver 1.0.0.0 and ver 1.0.0.1) and added them to the GAC. Then within the web.config, I added version 1.0.0.0 to the assemblies node and the application worked fine. Then I changed the version number to 1.0.0.1 and everything worked fine. Are you listing both assemblies version under the assemblies node? (Are you doing this?) <compilation debug="true"> <assemblies> <add assembly="PageLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bdc533f43df02cbe"/> <add assembly="PageLibrary, Version=1.0.0.1, Culture=neutral, PublicKeyToken=bdc533f43df02cbe"/> </assemblies> </compilation> The more we know, the easier it will be to help you out. ~Javier Lozano
Thanks Javier, Absolutely definitely there are no references to the "old" assembly in the web.config! The "MyCompany.MyProduct.WebUI" assembly is referred to (in a non strongly named manner) by the "Inherits" attributes in either the Global.asax or the aspx / ascx files. and also in a strongly named manner in the HTTPHandler, HTTPModule, and assemblies section of the web.config file Re compiling the whole site and copying all the files over worked but obviously I don't want to have to do this every time I want to update 1 assembly! Can someone explain when the files in c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\ get recompiled as I think the issue may be something here?