D
Dylan Parry
Hi folks,
I've written an application that (in a very cut down form) looks like
this:
namespace Opus2.Page {
public class Admin : System.Web.UI.Page {
public void Page_Load(object sender, EventArgs e) {
...
}
...
}
}
I have compiled it as a DLL file, copied it to the /bin directory for my
virtual host, and I am referencing it from my ASPX file like:
<%@ Page language="C#" Inherits="Opus2.Page.Admin"
validateRequest="false" %>
Now this assembly is used by several websites hosted on the same server,
so I thought what better way than to stick it in the GAC and be done
with it. That way, I thought, I could simply update the one DLL file
whenever I find bugs etc and all of the websites using it would reflect
the changes immediately.
So I created a strong name key, associated it with the assembly,
recompiled and copied it to the GAC. Then I deleted it from the /bin
directory for the virtual host and tried to reload the page. Didn't
work. Now I get the following message:
Parser Error Message: Could not load type 'Opus2.Page.Admin'.
So now I am a bit confused. My first thought is that maybe I can't have
a class that inherits System.Web.UI.Page in GAC in the way that I have
done it. Is it actually possible to do this?
Secondly, if it is impossible to do it this way, is it possible to
create a "helper" DLL file, in the /bin directory of the virtual host,
that contains no real code but uses the Opus2.dll file from the GAC to
accomplish what I was trying to do?
Thirdly, if none of the above, is there any alternative method that will
allow me to have one central copy of the DLL file used by all the sites?
I asked a similar question some time ago, but at that point I was using
shared hosting and did not have access to the server, but I am now
operating my own server and have full admin rights to mess everything up
should I choose to do so So there are no limitations/restrictions as
to what I can do this time round!
Cheers,
I've written an application that (in a very cut down form) looks like
this:
namespace Opus2.Page {
public class Admin : System.Web.UI.Page {
public void Page_Load(object sender, EventArgs e) {
...
}
...
}
}
I have compiled it as a DLL file, copied it to the /bin directory for my
virtual host, and I am referencing it from my ASPX file like:
<%@ Page language="C#" Inherits="Opus2.Page.Admin"
validateRequest="false" %>
Now this assembly is used by several websites hosted on the same server,
so I thought what better way than to stick it in the GAC and be done
with it. That way, I thought, I could simply update the one DLL file
whenever I find bugs etc and all of the websites using it would reflect
the changes immediately.
So I created a strong name key, associated it with the assembly,
recompiled and copied it to the GAC. Then I deleted it from the /bin
directory for the virtual host and tried to reload the page. Didn't
work. Now I get the following message:
Parser Error Message: Could not load type 'Opus2.Page.Admin'.
So now I am a bit confused. My first thought is that maybe I can't have
a class that inherits System.Web.UI.Page in GAC in the way that I have
done it. Is it actually possible to do this?
Secondly, if it is impossible to do it this way, is it possible to
create a "helper" DLL file, in the /bin directory of the virtual host,
that contains no real code but uses the Opus2.dll file from the GAC to
accomplish what I was trying to do?
Thirdly, if none of the above, is there any alternative method that will
allow me to have one central copy of the DLL file used by all the sites?
I asked a similar question some time ago, but at that point I was using
shared hosting and did not have access to the server, but I am now
operating my own server and have full admin rights to mess everything up
should I choose to do so So there are no limitations/restrictions as
to what I can do this time round!
Cheers,