Page view counter

Mind-bending problem with class library function

Last post 10-31-2007 10:57 AM by Charles Asbornsen. 14 replies.

Sort Posts:

  • Mind-bending problem with class library function

    10-25-2007, 5:45 AM
    • Loading...
    • kreid
    • Joined on 10-19-2006, 12:15 PM
    • Posts 95
    • Points 141

     Hi,

     I have been having a problem with Visual Studio not recognizing an overload method in a class library I am referencing from my web project - the wierdest thing is that SOMETIMES both functions are recognized in intellisense.  However, when I build my web app I get the error:

    "No overload for method sendEmail takes 4 arguments"

     
    I have tried numerous solutions over a long period of time.  Please go and read my original post: http://forums.asp.net/t/1170138.aspx to see what I have attempted so far.

    I thought posting the topic here might elicit a better response
     

    Thanks,

    k
     

    Filed under: ,
  • Re: Mind-bending problem with class library function

    10-25-2007, 8:37 AM

    See what happens if you comment out the other overloads so only the 4 parameter one is left.  I know that probably means it well break elsewhere, but maybe you will force the compiler to see it.

    Very strange error.  Do you have SP1? 

    I love to display the non-secure items...
    Charlie Asbornsen
    Dont forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
  • Re: Mind-bending problem with class library function

    10-25-2007, 8:58 AM
    • Loading...
    • david wendelken
    • Joined on 07-27-2005, 7:47 PM
    • Addis Abeba, Ethiopia
    • Posts 1,924
    • Points 11,935
    • Moderator
    1. I would verify both functions are public. :)
    2. Recompile the library.
    3. Delete the refererence to the library in my project.
    4. Reinstate the reference to the library in my project.
    5. Exit visual studio.
    6. Re-enter visual studio.
    7. Pray.
    8. Hoot and holler if you get lucky.

     

    If this answered your question, be sure to mark it as the answer. That way, everybody after you will know it's the answer also!
  • Re: Mind-bending problem with class library function

    10-25-2007, 11:42 AM
    • Loading...
    • kreid
    • Joined on 10-19-2006, 12:15 PM
    • Posts 95
    • Points 141

     Ok, so I tried David's suggestion first, no joy.

    Then I tried the first suggestion - I removed the original SendEmail function, and compiled my class library with only the function that was causing the problem.  Still the same problem with the second function.  Here's where it gets strange - when I comment out all references to my "problem" function and leave only the "good" function calls, it builds successfully, even though I commented the "good" function out of my class library.  I had a feeling this would happen, it's almost as if Visual Studio is retaining a reference to the old dll somewhere and laughing in my face every time I try to update the reference. 

    WHat I need is an expert who can identify the source of the problem.  I honestly believe my productivity would be doubled if it wasn't for the flakiness of visual studio ;-(

    By the way - how do i tell if i have SP1 -> I have version 8.0.50727.42  ??

     

    Thanks,

    k
     

    Filed under: ,
  • Re: Mind-bending problem with class library function

    10-25-2007, 2:08 PM

    It sounds like you have to do the Microsoft Mambo.  There's a .Net temp folder in there someplace, \v2.0.50727\Temporary ASP.NET Files, and I think that holds the evil persistent dlls.  I'd back it up and delete the contents and try recompiling.

    I love to display the non-secure items...
    Charlie Asbornsen
    Dont forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
  • Re: Mind-bending problem with class library function

    10-25-2007, 2:48 PM
    • Loading...
    • david wendelken
    • Joined on 07-27-2005, 7:47 PM
    • Addis Abeba, Ethiopia
    • Posts 1,924
    • Points 11,935
    • Moderator

    Sometimes the project files get funky stuff in them.

    Open your .csproj or .vbproj in notepad and see if you find any files listed in it that have the incorrect directory info. 

    If this answered your question, be sure to mark it as the answer. That way, everybody after you will know it's the answer also!
  • Re: Mind-bending problem with class library function

    10-25-2007, 2:54 PM

    Dave - the contractors are still here.  I'll be back at work prb around 4ish, your contributorness :)

    I love to display the non-secure items...
    Charlie Asbornsen
    Dont forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
  • Re: Mind-bending problem with class library function

    10-26-2007, 3:57 AM
    • Loading...
    • kreid
    • Joined on 10-19-2006, 12:15 PM
    • Posts 95
    • Points 141

    Tried that already, but I'll give it another try. 

     

    Charles Asbornsen:

    It sounds like you have to do the Microsoft Mambo.  There's a .Net temp folder in there someplace, \v2.0.50727\Temporary ASP.NET Files, and I think that holds the evil persistent dlls.  I'd back it up and delete the contents and try recompiling.

     
  • Re: Mind-bending problem with class library function

    10-26-2007, 9:28 AM
    • Loading...
    • kreid
    • Joined on 10-19-2006, 12:15 PM
    • Posts 95
    • Points 141

    So I have been doing some digging.  When I select "Go to definition" on Email.SendEmail, this was pointing to:

    D:\Documents and Settings\Administrator\Local Settings\Temp\3564$MyClassLibrary.dll$2.0.50727\MyClassLibrary.Email.cs

    This contained ONE function prototype - the four parameter function was not there - as i expected.  So, I thought I would just delete the Temp folder, problem solved.  Wrong.  When I built the project, it RE-CREATED the above folder and file with the same contents as before. Angry

    I then decided to go digging in registry:

    I found entries containing "MyClassLibrary" in

    HKEY_CURRENT_USER/Software/Microsoft/Search Assistant/ACMru/5603

    Also found entries containing "Email.SendEmail" in

    .../Microsoft/VisualStudio/8.0/Find, but I doubt these relate to the main problem.

     

    I need a solution to this problem fast; thanks in advance if you can help

  • Re: Mind-bending problem with class library function

    10-26-2007, 9:55 AM

    I'll send a private message to Allen Chen and see if he can help us out.

    I love to display the non-secure items...
    Charlie Asbornsen
    Dont forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
  • Re: Mind-bending problem with class library function

    10-29-2007, 5:06 AM
    • Loading...
    • kreid
    • Joined on 10-19-2006, 12:15 PM
    • Posts 95
    • Points 141

     Ok, great.  I think I need an expert's help.

    Filed under: , ,
  • Re: Mind-bending problem with class library function

    10-31-2007, 6:47 AM
    • Loading...
    • kreid
    • Joined on 10-19-2006, 12:15 PM
    • Posts 95
    • Points 141

    Is anyone out there?  I would appreciate it if someone would help with this issue.  I have tried everything i can think of.

    When I update the dll, the new dll is copied into my web app's bin folder - I know this because the modified date is today's date.  When I compile the project, the modified date changes to august - ie: the old dll is being copied in to the bin folder.  What is doing this; how can I stop it?

     

    Thanks,

    kreid 

  • Re: Mind-bending problem with class library function

    10-31-2007, 8:44 AM
    Answer

    Do you have the same project in two solutions?  We have that and it confuses the computer - make sure your reference is pointed at the right dll.

    Also, try removing the reference from the project, and do a search on your computer for other copies of the dll and delete them.  Then compile the library by itself.  Then add the new dll to your references and compile your project.

    I love to display the non-secure items...
    Charlie Asbornsen
    Dont forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
  • Re: Mind-bending problem with class library function

    10-31-2007, 10:52 AM
    • Loading...
    • kreid
    • Joined on 10-19-2006, 12:15 PM
    • Posts 95
    • Points 141

    Woohoo!

    It's working, but let me explain what I did for anyone else who has the same problem:

    I have ANOTHER class library (let's call it class library B) which is referencing my problem - they are referencing each other.  My Web App is referencing both. Yes, I know this is bad practice!!

    I removed all the dlls, rebuilt class library B, then class library A, then the Web App.  Problem solved.  When you add a reference to a class library to another project, it sounds fancy, but all it is doing is copying the other projects dll.  So in my case Class Library A and B both had each other's and their own dlls in their bin folder.  My web app must have been referencing the dll for Class library A in Class Library B's bin folder
     

  • Re: Mind-bending problem with class library function

    10-31-2007, 10:57 AM

    Oh I am just too smart to be able to stand myself today Wink  I'm glad that worked out - I hate when we have those 3 or 4 page threads.

    I love to display the non-secure items...
    Charlie Asbornsen
    Dont forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
Page 1 of 1 (15 items)