[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

my sneaky Global Assembly Cache

Posted on 2004-10-27
6
Medium Priority
?
323 Views
Last Modified: 2008-02-01
Hi,

I'm trying to build an assemly, and register it in the Global Assemply Cache.  I often change the source and have to recompile, uninstall the assembly from GAC, then re-install the assembly in GAC.  No problem, just a couple lines in my batch file:

csc /t:library /out:FutureShirts.dll AssemblyInfo.cs Global.cs Futura.cs
gacutil /u FutureShirts
gacutil /i FutureShirts.dll

It uninstalls and reinstalls fine.. However,  when I try to access the new methods that I added to the assembly, I get this error:

Method not found: Int32 FutureShirts.Futura.Multiply(Int32, Int32)

Note that this is different from the error I get when I try to access a method that doesn't actually exist:

CS0117: 'FutureShirts.Futura' does not contain a definition for 'Multiplyd'

After a ridiculous amount of testing and changing the name of the namespace and assmebly, I have figured out that the only methods that will work are the methods that are in the assmembly when I register in the GAC the very first time.  After that, any code added will just produce the "Method not found.." error.  It's insane.  Also, I can put the dll in the bin directory, and just run the assembly from there and it works fine..  

So does anyone have any ideas?  I'm about ready to apply the sledge hammer..

Thx - Trevor
0
Comment
Question by:trevorhartman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 8

Author Comment

by:trevorhartman
ID: 12425661
Note: i did this on another web server with another component and it worked fine.. the only difference is, in my AssemblyInfo.cs file, I forced the version to 1.0.0.0 so I don't have to change the <add assembly /> in my web.config:

[assembly: AssemblyVersion("1.0")]
[assembly: AssemblyKeyFile("FutureShirts.snk")]

Is this a problem?  

maybe I'll try letting it create a new version..
0
 
LVL 8

Author Comment

by:trevorhartman
ID: 12425709
wow, THAT WAS IT!  sick.  i  changed it to:

[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyKeyFile("FutureShirts.snk")]

so it created a new version, i modified the web.config, and it works.  

ok so new question for 500 points is:

how do I force it to be version 1.0.0.0 all the time and make it still work..  or.. is there any way I can do this without having to modify the web.config every time?  I'm not using visual studio yet..

Thanks - Trevor
0
 
LVL 1

Accepted Solution

by:
EugeneTrukhin earned 1200 total points
ID: 12425798
//After a ridiculous amount of testing and changing the name of the namespace and assmebly, I have figured out that the only methods that will work are the methods that are in the assmembly when I register in the GAC the very first time.  After that, any code added will just produce the "Method not found.." error.  It's insane.  Also, I can put the dll in the bin directory, and just run the assembly from there and it works fine..


Sometimes to fix this, you need to stop your IIS and clean-up your temporary ASP.Net files. In this way this kind of problem can be fixed.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 17

Assisted Solution

by:AerosSaga
AerosSaga earned 800 total points
ID: 12425799
0
 
LVL 8

Author Comment

by:trevorhartman
ID: 12425934
I have tried manually removing the dll, and the assembly from the GAC.  It didn't work.  I bet it I would need to restart IIS to make it work..
0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12426001
hmm...maybe so
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question