PC Review


Reply
Thread Tools Rate Thread

Assembly Version Issues

 
 
Christopher Pragash
Guest
Posts: n/a
 
      27th Aug 2003
Hello All,

I am developing a "Business Object" Assembly and "Data Object" Assembly
(Remoted) , both of which would be called from .NET and from ASP (using COM
layer Interop). I deployed all the assemblies into the GAC and it had a
specific version when I deployed it. I developed a service that hosts the
Remoting Objects and I deployed the dlls in the GAC and things worked fine.

I made a few changes to the COM Interop layer, and when I complied it the
versions became different, and even after I manually deploy it to the GAC,
the Service does not load the Dll from the GAC, even after restarting the
service. It always loads the Dll from its Bin Directory. How can I resolve
this issue? How do I make all the projects load the assemblies from the GAC?
Is there a way I could force this?

Thanks in advance...

regards,
Chris


 
Reply With Quote
 
 
 
 
Jim Blizzard [MSFT]
Guest
Posts: n/a
 
      27th Aug 2003
Hi Chris,

Thanks for posting your question.

There are a couple of things you can do to make things easier.

When you're calling .net assemblies through COM interop you're dealing with
the world of the registry again. So it helps if you assign your .NET class
a GUID. It's kinda' like setting "binary compatibility" on in VB6. (It's a
stretch, but you could think of it that way.) You can do this by importing
System.Runtime.InteropServices and adding the Guid attribute to the class,
such as
:
Imports System.Runtime.InteropServices
<Guid("C4ACAC63-A35D-4a0f-9AA1-26DA6313D717")> Public Class MyClass
:
and so on. (Change the decorations as appropriate for a C# version of
this.)

Another thing you can do is explicitly set the version number in the
AssemblyInfo file. The default AssemblyVersion is "1.0.*" which lets VS.NET
change the version number every time you compile. Go ahead and manually
assign all 4 digits yourself, such as "1.0.0.0" and then you can control
when the version number changes.

Hope this helps,
bliz

--
Jim Blizzard | http://weblogs.asp.net/jblizzard
Sr .NET Developer Specialist
Microsoft

Your Potential. Our Passion.

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only, so that others may benefit. Thanks.


"Christopher Pragash" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello All,
>
> I am developing a "Business Object" Assembly and "Data Object" Assembly
> (Remoted) , both of which would be called from .NET and from ASP (using

COM
> layer Interop). I deployed all the assemblies into the GAC and it had a
> specific version when I deployed it. I developed a service that hosts the
> Remoting Objects and I deployed the dlls in the GAC and things worked

fine.
>
> I made a few changes to the COM Interop layer, and when I complied it the
> versions became different, and even after I manually deploy it to the GAC,
> the Service does not load the Dll from the GAC, even after restarting the
> service. It always loads the Dll from its Bin Directory. How can I resolve
> this issue? How do I make all the projects load the assemblies from the

GAC?
> Is there a way I could force this?
>
> Thanks in advance...
>
> regards,
> Chris
>
>



 
Reply With Quote
 
Christopher Pragash
Guest
Posts: n/a
 
      27th Aug 2003
Hello Jim,

Thanks for the response. Manually controlling the version number did resolve
some of my issues. I'm having trouble loading the right Assembly. My windows
service that hosts the remoting object always loads the assembly from the
Bin directory, even though I have the assembly installed in the GAC. How do
I force the service to load the assemblies from the GAC? Is this possible?

Thanks in advance again...appreciate your effort.

Thanks,
Chris

"Jim Blizzard [MSFT]" <(E-Mail Removed)> wrote in message
news:3f4c4c31$(E-Mail Removed)...
> Hi Chris,
>
> Thanks for posting your question.
>
> There are a couple of things you can do to make things easier.
>
> When you're calling .net assemblies through COM interop you're dealing

with
> the world of the registry again. So it helps if you assign your .NET

class
> a GUID. It's kinda' like setting "binary compatibility" on in VB6. (It's

a
> stretch, but you could think of it that way.) You can do this by

importing
> System.Runtime.InteropServices and adding the Guid attribute to the class,
> such as
> :
> Imports System.Runtime.InteropServices
> <Guid("C4ACAC63-A35D-4a0f-9AA1-26DA6313D717")> Public Class MyClass
> :
> and so on. (Change the decorations as appropriate for a C# version of
> this.)
>
> Another thing you can do is explicitly set the version number in the
> AssemblyInfo file. The default AssemblyVersion is "1.0.*" which lets

VS.NET
> change the version number every time you compile. Go ahead and manually
> assign all 4 digits yourself, such as "1.0.0.0" and then you can control
> when the version number changes.
>
> Hope this helps,
> bliz
>
> --
> Jim Blizzard | http://weblogs.asp.net/jblizzard
> Sr .NET Developer Specialist
> Microsoft
>
> Your Potential. Our Passion.
>
> This posting is provided "AS IS" with no warranties, and confers no

rights.
> Please reply to newsgroups only, so that others may benefit. Thanks.
>
>
> "Christopher Pragash" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hello All,
> >
> > I am developing a "Business Object" Assembly and "Data Object" Assembly
> > (Remoted) , both of which would be called from .NET and from ASP (using

> COM
> > layer Interop). I deployed all the assemblies into the GAC and it had a
> > specific version when I deployed it. I developed a service that hosts

the
> > Remoting Objects and I deployed the dlls in the GAC and things worked

> fine.
> >
> > I made a few changes to the COM Interop layer, and when I complied it

the
> > versions became different, and even after I manually deploy it to the

GAC,
> > the Service does not load the Dll from the GAC, even after restarting

the
> > service. It always loads the Dll from its Bin Directory. How can I

resolve
> > this issue? How do I make all the projects load the assemblies from the

> GAC?
> > Is there a way I could force this?
> >
> > Thanks in advance...
> >
> > regards,
> > Chris
> >
> >

>
>



 
Reply With Quote
 
Jim Blizzard [MSFT]
Guest
Posts: n/a
 
      29th Aug 2003
Hi Chris,

This MSDN library article should help:
"How the Runtime Locates Assemblies" :
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconhowruntimelocatesassemblies.asp

(watch out for line breaks in the URL)

And underneath that section (look in the table of contents) there are a
number of steps the runtime goes through, described in even more detail.

I wish I had a quick answer for you....

Hope this helps,
bliz
--
Jim Blizzard | http://weblogs.asp.net/jblizzard
Sr .NET Developer Evangelist
Microsoft

Your Potential. Our Passion.

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only, so that others may benefit. Thanks.


--------------------
>From: "Christopher Pragash" <(E-Mail Removed)>
>References: <(E-Mail Removed)>

<3f4c4c31$(E-Mail Removed)>
>Subject: Re: Assembly Version Issues
>Date: Wed, 27 Aug 2003 08:31:04 -0400
>Lines: 95
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
>Message-ID: <(E-Mail Removed)>
>Newsgroups: microsoft.public.dotnet.framework
>NNTP-Posting-Host: 168-215-135-201.gen.twtelecom.net 168.215.135.201
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework:52362
>X-Tomcat-NG: microsoft.public.dotnet.framework
>
>Hello Jim,
>
>Thanks for the response. Manually controlling the version number did

resolve
>some of my issues. I'm having trouble loading the right Assembly. My

windows
>service that hosts the remoting object always loads the assembly from the
>Bin directory, even though I have the assembly installed in the GAC. How do
>I force the service to load the assemblies from the GAC? Is this possible?
>
>Thanks in advance again...appreciate your effort.
>
>Thanks,
>Chris
>
>"Jim Blizzard [MSFT]" <(E-Mail Removed)> wrote in message
>news:3f4c4c31$(E-Mail Removed)...
>> Hi Chris,
>>
>> Thanks for posting your question.
>>
>> There are a couple of things you can do to make things easier.
>>
>> When you're calling .net assemblies through COM interop you're dealing

>with
>> the world of the registry again. So it helps if you assign your .NET

>class
>> a GUID. It's kinda' like setting "binary compatibility" on in VB6.

(It's
>a
>> stretch, but you could think of it that way.) You can do this by

>importing
>> System.Runtime.InteropServices and adding the Guid attribute to the

class,
>> such as
>> :
>> Imports System.Runtime.InteropServices
>> <Guid("C4ACAC63-A35D-4a0f-9AA1-26DA6313D717")> Public Class MyClass
>> :
>> and so on. (Change the decorations as appropriate for a C# version of
>> this.)
>>
>> Another thing you can do is explicitly set the version number in the
>> AssemblyInfo file. The default AssemblyVersion is "1.0.*" which lets

>VS.NET
>> change the version number every time you compile. Go ahead and manually
>> assign all 4 digits yourself, such as "1.0.0.0" and then you can control
>> when the version number changes.
>>
>> Hope this helps,
>> bliz
>>
>> --
>> Jim Blizzard | http://weblogs.asp.net/jblizzard
>> Sr .NET Developer Specialist
>> Microsoft
>>
>> Your Potential. Our Passion.
>>
>> This posting is provided "AS IS" with no warranties, and confers no

>rights.
>> Please reply to newsgroups only, so that others may benefit. Thanks.
>>
>>
>> "Christopher Pragash" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > Hello All,
>> >
>> > I am developing a "Business Object" Assembly and "Data Object" Assembly
>> > (Remoted) , both of which would be called from .NET and from ASP (using

>> COM
>> > layer Interop). I deployed all the assemblies into the GAC and it had a
>> > specific version when I deployed it. I developed a service that hosts

>the
>> > Remoting Objects and I deployed the dlls in the GAC and things worked

>> fine.
>> >
>> > I made a few changes to the COM Interop layer, and when I complied it

>the
>> > versions became different, and even after I manually deploy it to the

>GAC,
>> > the Service does not load the Dll from the GAC, even after restarting

>the
>> > service. It always loads the Dll from its Bin Directory. How can I

>resolve
>> > this issue? How do I make all the projects load the assemblies from the

>> GAC?
>> > Is there a way I could force this?
>> >
>> > Thanks in advance...
>> >
>> > regards,
>> > Chris
>> >
>> >

>>
>>

>
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The application requires that assembly office Version 12.0.0.0 be installed in the Global Assembly Cache (GAC) first. Bill Nguyen Microsoft VB .NET 2 30th May 2008 11:17 PM
What is the difference between runtime version and the version propery in a .net assembly nenzax Microsoft Dot NET Framework 1 18th Feb 2007 08:24 PM
is there any way to get to a unique build verion of an assembly at runtime? e.g. a version that is unique to the time that the assembly was built? Daniel Microsoft Dot NET Framework 1 14th Dec 2004 04:10 PM
is there any way to get to a unique build verion of an assembly at runtime? e.g. a version that is unique to the time that the assembly was built? Daniel Microsoft C# .NET 1 10th Dec 2004 03:06 AM
Assembly version from unloaded assembly bw Microsoft Dot NET Framework 5 14th Aug 2003 06:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:15 PM.