473,948 Members | 17,405 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Installing Assembly in GAC

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.P age {
public void Page_Load(objec t 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.Adm in'.

So now I am a bit confused. My first thought is that maybe I can't have
a class that inherits System.Web.UI.P age 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,

--
Dylan Parry
http://electricfreedom.org -- Where the Music Progressively Rocks!
Jun 12 '06 #1
2 1679
Dylan Parry wrote:
So now I am a bit confused. My first thought is that maybe I can't have
a class that inherits System.Web.UI.P age in GAC in the way that I have
done it. Is it actually possible to do this?

[...]

As it turns out, it is entirely possible to do this, but I needed to
reference the assembly in the web.config file like:

<add assembly="Opus2 , Version=1.0.0.0 , Culture=neutral ,
PublicKeyToken= d65b870916fbf4c 7" />

So that the runtime knew where to look for it. It seems a bit strange
that you need to do this, IMHO, in that putting something in an
established global location then telling the runtime where to find it
seems a bit redundant to me.

Anyway, it now works just fine, as long as I remember to change the
web.config whenever I change the version number for the assembly!

--
Dylan Parry
http://webpageworkshop.co.uk -- FREE Web tutorials and references
Jun 12 '06 #2
I don't think you can put something you inherit from the web,ui in GAC. I
have try it with a class but not something with an UI.

chanmm

"Dylan Parry" <us****@dylanpa rry.com> wrote in message
news:8a******** *******@dylanpa rry.com...
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.P age {
public void Page_Load(objec t 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.Adm in'.

So now I am a bit confused. My first thought is that maybe I can't have
a class that inherits System.Web.UI.P age 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,

--
Dylan Parry
http://electricfreedom.org -- Where the Music Progressively Rocks!

Jun 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1545
by: Dan | last post by:
Hi when installing a shared assembly into the GAC, do I have to check whether the GAC already have the assembly with the same strong name(name,version,publickeytoken and culture) before installing it using gacutil.exe? when there is another copy already installed do I need to take special steps to quit the installation process. Is this check necessary? or the gacutil.exe or the GAC will handle this scenario automatically and will not...
5
6373
by: McGeeky | last post by:
Is it possible to install an assembly on a remote machine's GAC? I don't see an option for it using gacutil.exe -- McGeeky http://mcgeeky.blogspot.com
0
1294
by: Ed | last post by:
Hi, I have to install a service in my PC which has been developed by my company. While installation the System.Reflection.ReflectionTypeLoadException exception is thrown. And the log is as follows - **********XXXX.installlog starts******************************* Installing assembly 'c:\program files\audiosoft\service\XXXX.exe'. Affected parameters are: assemblypath = c:\program files\audiosoft\service\XXXX.exe
7
2934
by: Adam | last post by:
Im trying to add an httphandler for all *.sgf file extensions. I have developed the handler, 1. installed it into the gac 2. added it to the machine.config: <httpHandlers> <add verb="*" path="*.sgf" type="CustomExtensionHandler, Extenders.CustomExtensionHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d831d925597c1031" validate="True"/> </httpHandlers>
11
5805
by: tshad | last post by:
I have a small Windows Service program that just has a timer on it and it built fine. I try to install it using InstallUtil and I get the following message: System.ComponentModel.Win32Exception: The account name is invalid or does not exist, or the password is invalid for the account name specified I am in the same folder my program is in (MyService.exe). I assume it has to do with Logon Credentials.
2
1624
by: J | last post by:
hi, I'm having a problem installing a service created in vb.net 2003 on a windows 2000 server. I have installed the service on a few XP machines with out any problems...but the 2 servers (win 2000 server sp4) I have triend have the same error (both are on diffrent domains and have framework v1.1 installed; 1 is a domain controler, the other is not) An exception occurred during the Install phase. System.ComponentModel.Win32Exception:...
0
4858
by: Anonieko Ramos | last post by:
Self Installing Service Enter a topic name to show or a new topic name to create; then press Enter .. Start by writing a service. This involves deriving a class from System.ServiceProcess.ServiceBase and overriding a few methods. It's detailed in the documentation. Once you have your service written, you'll need to add an installer
0
1004
by: Dave O | last post by:
Has anyone had experience loading a previous version of an assemblie's settings when installing a newer version of the assembly? for example, the old assembly version is 1.0.0.0 and its settings file is stored in <company_name>\<product_name>\1.0.0.0 The new assembly version is 1.0.0.1 and it should load the settings from 1.0.0.0 the first time it is used, then use the settings from version 1.0.0.1 thereafter.
0
1960
by: job | last post by:
Mohamed Sharaf's has produced a Microsoft.Practices.EnterpriseLibrary production server installer: https://blogs.msdn.com/mohamed_sharafs_blog/archive/2005/09/18/470854.aspx Running the installer produces the message log below for every dll. I'm not sure if there is a problem! and how to solve the problem? Installing assembly 'd:\inetpub\wwwroot\bin\microsoft.practices.enterpriselibrary.exceptionhandling.logging.dll'.
15
2449
by: =?Utf-8?B?RWxpb3Ro?= | last post by:
I try to install Windows Services but it show this error during the installation process, "Insufficient System resources exist to complete the requested service." I created this Services in VB 2005. I has other Windows Services installed on this machine. I try to install in other computer with the same specification and its is OK. Specification
0
10165
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9988
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11580
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
11354
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9898
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6119
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4541
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3547
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.