Last post Dec 27, 2005 05:40 PM by tracy_mcloud
Dec 27, 2005 05:40 PM|tracy_mcloud|LINK
I have 6 ASP.NET applications that utilize 4 custom assemblies (API - mostly business objects) and one shared resource (which is itself a web project) one for each of 6 of our brands. These are dealer network support applications and are
My shared application is set up on the server(s) as a virtual directory for each of these 6 apps so that I have direct file access to any resources it provides which contain:
The shared project was set up as a web app since virtual directories don't show up in the project folder in VS '03 (something thankfully fixed in '05) and this is, obviously, where I spend a great deal of my time developing (controls specifically).
As such, the controls are user controls (.ascx), not custom controls, and are registered in the applications by the .ascx file name only. This set up has worked just fine to this point by using the directory/file/Tagname (rather than assembly/namespace)
to register these controls within the web forms in each application.
I've always had a reference to the shared project in each of the applications as I had a very limited need to instantiate a couple of objects explicitly in the code-behind of a couple of application pages for reasons I won't elaborate
Well.. trying to get my applications VS '05 ready, I'm trying to eliminate this reference to the shared project since you can no longer reference a web project. I've removed the need for this reference inasmuch as I no longer need the
ability to create objects programmatically where I did before. So I delete the reference, run a re-build on the solution and all compiles fine. However, now I'm getting a "
Could not load type 'X.X.X.X..SharedApp.[classname]' " runtime error in any control that is being called by the application.
All the control registrations are by FILE name only and I have no problems with accessing other files (images, docs, etc) via my virtual 'shared' directory so I know the app knows it's there. When I put the reference back to the Shared
project from the application all is well again.
Why would the actual reference to the shared app make ANY difference at all when the controls are registered by filename and not by assembly? This morning I tried moving all of the controls to a separate class library and changed a couple
of page control registrations to access the assembly rather than the file. This works fine, but of course as all of these controls are user controls, any front end from the .ascx file isn't included. I do NOT want to have to go and re-write these as custom
controls so that I can access them in this way as there are about 50+ of them and most are relatively complex.
Again - these controls are where all of my apps' business logic resides and is shared across (currently) 6 apps so moving the controls into the app directories themselves is out of the question.
I've checked and re-checked that the .ascx file is associating the correct code-behind and classname. As most of us are, I'm quite familiar with what this error usually means and it does NOT seem to be any of the usual suspects in this
case. I'm sure this is something stupid... but any help would be great - I really want to think that we'll be up with VS '05 soon.