First problem :
I am using some externall buisness libraries and they have strange namespace for example System.Web.UI.Page
. Cant do nothing about that. Problem occurs in ASP.NET when libraries are loaded everything is fine but problem occurs when displaying pages :
CS0433: The type 'System.Web.SessionState.IRequiresSessionState' exists in both
So basically C# tries to compile page - but dont know which library to use for this type
I found solution with externall alliases but, then there is a problem in designer cause every time i modify page it will break naming( really hard to mantain ) - desginer will switch name from "MyNewExternalAlliase"->"Global"
, or when adding new ellemnts they will show with global::. It will be really time consuming.
Question :
Can i modify this autogenerated code for ASP.NET pages/controls if i could somehow inject into process and do simple do string replace i could use double alliase and everything would work fine. For clarification i mean this kind files :
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\f3552813\29b6906c\App_Web_XXXXX.aspx.65a2d1ee.p58-fzio.0.cs
Update 1. You guys didnt understand problem, standard system library System.Web has class System.Web.UI.Page, library that i am loading during runtime has the same type( namespace and class ). And now when ASP.net compiles pages - *.aspx, *.ascx files are compiled - it cant tell which library should it use and i get error :
CS0433: The type 'System.Web.UI.Page' exists in both dlls