473,396 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Assembly Reference - GAC

We have more than one version of an assembly that contains web controls
installed in the GAC. In our application, we want to always reference the
most recent version of the assembly WITHOUT manually changing the version
numbers in the .aspx files (<% Register TagPrefix... lines). I can manually
remove the version information from the aspx files and all is well. It
seems to be using the most recent version just fine.

One problem is, if we add a new page and drag-n-drop a control that is in an
assembly in the GAC, it hardcodes the version number into the web form. We
have to manually remove it for each new page...is there an easier way?

Is there a better way to do this while keeping the assemblies in the GAC and
w/o setting CopyLocal to True?

Thanks,
Mythran
Mar 26 '07 #1
4 6010
Hello Mythran,

You can use "publisher policy" where you can specify that your app need to
use the latest version of your assembly
http://msdn.microsoft.com/library/de...policyfile.asp

---
WBR, Michael Nemtsev [C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

MWe have more than one version of an assembly that contains web
Mcontrols installed in the GAC. In our application, we want to always
Mreference the most recent version of the assembly WITHOUT manually
Mchanging the version numbers in the .aspx files (<% Register
MTagPrefix... lines). I can manually remove the version information
Mfrom the aspx files and all is well. It seems to be using the most
Mrecent version just fine.
M>
MOne problem is, if we add a new page and drag-n-drop a control that
Mis in an assembly in the GAC, it hardcodes the version number into
Mthe web form. We have to manually remove it for each new page...is
Mthere an easier way?
M>
Mar 27 '07 #2


"Michael Nemtsev" <ne*****@msn.comwrote in message
news:a2***************************@msnews.microsof t.com...
Hello Mythran,

You can use "publisher policy" where you can specify that your app need to
use the latest version of your assembly
http://msdn.microsoft.com/library/de...policyfile.asp

---
WBR, Michael Nemtsev [C# MVP]. My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

MWe have more than one version of an assembly that contains web
Mcontrols installed in the GAC. In our application, we want to always
Mreference the most recent version of the assembly WITHOUT manually
Mchanging the version numbers in the .aspx files (<% Register
MTagPrefix... lines). I can manually remove the version information
Mfrom the aspx files and all is well. It seems to be using the most
Mrecent version just fine.
MMOne problem is, if we add a new page and drag-n-drop a control that
Mis in an assembly in the GAC, it hardcodes the version number into
Mthe web form. We have to manually remove it for each new page...is
Mthere an easier way?
M>
Found a way to make the application use a specific version and only have to
update the web.config...which isn't too bad. The IDE still inserts the
version in the ASPX file automatically when I add a control from an assembly
that the form hasn't used yet...have to manually remove those version #'s
though....there a way around that?

Thanks,
Mythran
Mar 27 '07 #3
Hello Mythran,

For the GAC assemblies u need to specify the fully qualified name in web.config.
only if your assembly is not in gac (in bin directory) u can refer to by
without full-qualified name

---
WBR, Michael Nemtsev [C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

MFound a way to make the application use a specific version and only
Mhave to update the web.config...which isn't too bad. The IDE still
Minserts the version in the ASPX file automatically when I add a
Mcontrol from an assembly that the form hasn't used yet...have to
Mmanually remove those version #'s though....there a way around that?
M>
Mar 28 '07 #4


"Michael Nemtsev" <ne*****@msn.comwrote in message
news:a2***************************@msnews.microsof t.com...
Hello Mythran,

For the GAC assemblies u need to specify the fully qualified name in
web.config.
only if your assembly is not in gac (in bin directory) u can refer to by
without full-qualified name
When I create an aspx page and drop a control that is located in the
assembly in the GAC, regardless of what I have in my web.config, the IDE
still inserts the fully qualified assembly name in the page. I have to
manually remove the fully qualified name and replace it with the partial
name. Is there a way to have the IDE only insert the assembly's partial
name into the ASPX page for the assemblies located in the GAC?

Basically, what I have, just to make sure we are on the same page:

Created a web control in an assembly, gave it a strong name, and installed
it into the GAC.
Created a web project and referenced the assembly in the GAC.
Added the web control from the GAC'ed assembly to the toolbox.
Modified the web.config file and placed the <qualifyAssemblyelement (and
proper parent/child elements).
Drag-n-dropped the web control from the toolbox onto the form.
Open the form in HTML view and at the top of the html, the @Register
directive shows the fully qualified assembly name.

I manually change this name to the partial name which matches the partial
name stored in the web.config file but I don't want to have to do this if
the IDE can see I don't need the fully qualified name. I doubt much can be
done to "force" the ide to listen to me but hey, worth a shot.

Thanks,
Mythran
Mar 28 '07 #5

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

Similar topics

1
by: Paul Klanderud | last post by:
I'm having a problem with being unable to remove a reference to an old, nonexistent version of a strongly- named assembly. I should mention that my issues arose at the same time I upgraded from...
3
by: Mountain Bikn' Guy | last post by:
This code (adapted from the examples in the docs) doesn't make complete sense to me. I have it working, but I'm wondering why I need to declare an assembly reference in 2 places. TIA. Dave ...
1
by: Greg Patrick | last post by:
My problem: I load an some assemblies (strong named) from a byte array using Assembly.Load(byte). They load fine. But one one of them is actually accessed, it's referenced assemblies can't be...
2
by: Brad | last post by:
I have one of those seemingly simple questions that evades/confuses me. I've created an assembly with bass classes (classes meant to be inherited in other assemblys). In a secondary assembly (my...
11
by: Just Me | last post by:
I have a solution containing many usercontrol projects. When I wish to reference a usercontrol in another project I can select either the project or the assembly. Does it make a difference which...
3
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here...
5
by: Diffident | last post by:
Hello All, I am trying to add an assembly to GAC but having difficult time figuring out the concept of GAC. This is what I am trying to do.... 1. Installed NUnit framework whose DLL...
2
by: Terry | last post by:
I am finally able to call my .Net object from a VB6 project (see posting 'Calling VB.Net classes from VB6', thanks to the reference Tony gave me to:...
14
by: Monty | last post by:
Hello, I have created a solution which has both a web UI and a winform UI, the latter is just for administrators. The Web UI (a Web Application Project) and the winform project both...
2
by: Andrus | last post by:
I need compile in-memory assembly which references to other in-memory assembly. Compiling second assembly fails with error Line: 0 - Metadata file 'eed7li9m, Version=0.0.0.0, Culture=neutral,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...

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.