locked
Unexpected error writing to metadata... Record not found on lookup RRS feed

  • Question

  • Hey

    I've been trying for 3 days to figure out this error, to no avail. Now I humbly ask for help or insight.

    The error comes up when I try to compile a class library project "Business" with a bunch of static classes, that references another class library project named "Services", which contains three providers. I am accessing static methods in the three ProviderManager classes.
    The Services project itself compiles fine. The Business project does not compile because of the error

    I hunted down the error: when I make the function call ProviderManagerClass.DoSomething() the compile process somehow stops and show 1 error:
    Unexpected error writing to metadata "...bin/debug/Business.dll". 'Record not found on lookup'

    The only way to get rid of that error is to comment out the single lines where I call the ProviderManagerClass.DoSomething() stuff.
    Even if that ProviderManagerClass.DoSomething() function does nothing at all, the error comes up anyway.

    If I comment out all those lines, the project compiles.

    Why is that?

    I'm using VS2008 C# on XP. I tried this on three different machines -- all the same. I also tried creating a new colution with just those tow project, no other projects. Won't help either.
    • Moved by waldenk - MSFT Thursday, July 24, 2008 9:49 PM This is a language compilation issue. The C# forum may be able to provide further assistance. (Moved from Visual Studio Debugger to Visual C# Language)
    Thursday, July 24, 2008 12:03 PM

Answers

  • Why don't you fill *us* in on what you have discovered which seems to shed a different light on your issue....which you are also getting help from here:

    Unexpected error writing to metadata ... 'Record not found on lookup'
    William Wegerson (www.OmegaCoder.Com)
    • Marked as answer by jack 321 Tuesday, July 29, 2008 2:28 AM
    Saturday, July 26, 2008 3:44 PM
    Moderator
  • The OP has posted this in many places.  I responded to at least one that I remember.  I think we can safely ignore this particular one, nothing to go by anyway.

    Hans Passant.
    • Marked as answer by jack 321 Tuesday, July 29, 2008 2:29 AM
    Saturday, July 26, 2008 11:43 PM
    Moderator

All replies

  • Why don't you fill *us* in on what you have discovered which seems to shed a different light on your issue....which you are also getting help from here:

    Unexpected error writing to metadata ... 'Record not found on lookup'
    William Wegerson (www.OmegaCoder.Com)
    • Marked as answer by jack 321 Tuesday, July 29, 2008 2:28 AM
    Saturday, July 26, 2008 3:44 PM
    Moderator
  • The OP has posted this in many places.  I responded to at least one that I remember.  I think we can safely ignore this particular one, nothing to go by anyway.

    Hans Passant.
    • Marked as answer by jack 321 Tuesday, July 29, 2008 2:29 AM
    Saturday, July 26, 2008 11:43 PM
    Moderator
  • OK so since no one was able to help, I finally created a new project and added each file manually. That solved the problem.
    however, upon comparing the project .proj files themselves (since I assume the error must be in those files since all other files were 100% identical) I found no differences using WinMerge.
    The only difference was that each code file (.cs) had a subTag <codetype> upon whose removal the project still compiled.

    So in the end, I still do not know what caused the error. But know how to get rid of it.

    Thanks for all *your* help!
    Tuesday, July 29, 2008 2:35 PM
  • Just as an additional note, I also encountered this problem. Mine was caused by accidentally having two projects in a solution set to the same assembly name.
    Thursday, January 28, 2010 1:45 PM
  • Hi,

    look for your class library project's properties (When you right click on it, go to properties then in Application tab). This error shows up when you got two projects with the same "Assembly name" or "Default namespace".

    • Proposed as answer by echaplin Thursday, September 9, 2010 4:24 PM
    Sunday, July 4, 2010 3:37 PM
  • Jnaic's suggestion turned out to be my problem. I had a class library and an winform app with the same assembly name. I figured this would be fine because one would be "Myapp.dll" and the other would be named "Myapp.exe", but it turns out the compiler hates it. I changed the name of the executable to something else and it solved the problem.
    Thursday, September 9, 2010 4:23 PM