Symptoms:
Building a .NET 2003 solution with "Register for COM Interop" set to
TRUE causes the error [...can not load required library MSCOREE.TLB]
My Cause:
I installed SQL Server 2005 beta, which installs .NET Framework 2 BETA.
I later uninstalled 2005 and Framework 2.0 Beta, and it left remnants
of the framework 2.0 on my system.
Things I tried (that didn't work):
Searched all over the net for solutions.
Using regasm on mscoree.tlb, mscoree.dll, mscorlib.tlb, etc.
Using regtlib on mscoree.tlb and mscorlib.tlb
Using regsvr32 on mscoree.dll in system32
Uninstalling .NET Framework 1.1 and .NET Framework SDK 1.1
Reinstalling .NET Framework 2.2 and .NET Framework SDK 1.1
Repairing Visual Studio .NET 2003
**** Very Interesting *****:
I searched the registry, looking for remnants of .NET Framework 2.0
(version number is v2.0.40607, I searched for "2.0.40607" )
Interesting, came up with a lot of hits.
I am a confident registry editor, so I went ahead and started deleting
everthing I found (the c:\winnt\Microsoft .NET\Framework\v2.0.40607
didn't exist on my hard drive anyway)
I came across a few keys the referenced mscoree.tlb and mscorlib.tlb
**IN THE NOW NON-EXISTANT FRAMEWORK v2.0.40607 DIRECOTRY ***.
Keys:
*
[HKEY_CLASSES_ROOT\TypeLib\{5477469E-83B1-11D2-8B49-00A0C9B7C9C4}\2.0]
*
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\257B19FB0ED6ADF45A60A302704BC07E]
*[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\73A79C73C68925E4B80577C6780FBEC6]
*[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs]
(within the KEYS)
I deleted all these branches (except for the last one, only deleted the
keys referencing v2.0.40607).
* I also found a bunch of places where there was a reference to other
framework DLLs version \2.0 and pointing at the framework v2.0.40607
directory. I cleared these out as well.
I was searching the registry while waiting for the very long .NET 2003
repair.
So, somewhere along the lines (either the registry editing, or the
repair, my problem was fixed.
I advise anyone who's getting the error to first check for .NET 2.0
beta trash in the registry, clear it out, and retry your compile.
Then, if that fails, do the uninstall/reinstall/repair of framework and
VS.NET.
-Andrew Arace
Software Architect
Willy Denoyette [MVP] - 30 Apr 2005 22:44 GMT
> Symptoms:
> Building a .NET 2003 solution with "Register for COM Interop" set to
[quoted text clipped - 55 lines]
> -Andrew Arace
> Software Architect
This is one of the things you have to keep in mind when upgrading,
mscoree.dll (system32) replaces the previous version and both the dll and
its tlb are registered, as it's a shared component, the dll will only be
removed all framework versions are removed.
Now, when removing the Beta v2 version mscoree.tlb gets
removed/unregistered, running vs2003 and registering for interop, shouldn't
be a problem as the previous version is still registered and it's typelib
should be compatible with the newer mscoree.dll.
So I guess your problem is that oneway or another, the v1.1 mscoree.tlb must
have been removed/unregistered before you removed v2.0.
Willy.
jarmopy - 10 Jun 2005 10:46 GMT
Hi,
I had exactly the same problem as Andrew and I tried the following registry
changes he suggested:
From Andrew:
######################################
I am a confident registry editor, so I went ahead and started deleting
everthing I found (the c:\winnt\Microsoft .NET\Framework\v2.0.40607
didn't exist on my hard drive anyway)
I came across a few keys the referenced mscoree.tlb and mscorlib.tlb
**IN THE NOW NON-EXISTANT FRAMEWORK v2.0.40607 DIRECOTRY ***.
Keys:
*
[HKEY_CLASSES_ROOT\TypeLib\{5477469E-83B1-11D2-8B49-00A0C9B7C9C4}\2.0]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\257B19FB0ED6ADF45A60A302704BC07E]
*[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\73A79C73C68925E4B80577C6780FBEC6]
*[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs]
(within the KEYS)
I deleted all these branches (except for the last one, only deleted the
keys referencing v2.0.40607).
* I also found a bunch of places where there was a reference to other
framework DLLs version \2.0 and pointing at the framework v2.0.40607
directory. I cleared these out as well.
######################################
The previous changes were enough, it started to work again.
It was not necessary to reinstall .NET studio.
Thanks a lot Andrew !
Sunny and bugfree summer for everybody !!!
Jarmo