Solved

my sneaky Global Assembly Cache

Posted on 2004-10-27
294 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
Question by:trevorhartman
    6 Comments
     
    LVL 8

    Author Comment

    by:trevorhartman
    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
    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:
    //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
     
    LVL 17

    Assisted Solution

    by:AerosSaga
    0
     
    LVL 8

    Author Comment

    by:trevorhartman
    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
    hmm...maybe so
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
    I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
    With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    875 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

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now