Here's what I did:
* Reviewed http://support.microsoft.com/kb/815808
* Brought up the command line prompt for the VS 2005 tools.
* Created a key with this command:
sn -k CobraGAC.snk
* Added this to CobraLang.cobra:
assembly
has AssemblyKeyFile(r'C:\Documents and Settings\Chuck\...\SourceCobraGAC.snk')
cobra -bsl -v -key-file:CobraGAC.snk
* And installed the resulting DLL to the GAC with:
gacutil -I Cobra.Lang.dll
* And verified it was there by listing it with:
gacutil /l Cobra.Lang
* I then deleted the Cobra.Lang.dll in the current directory and tried it out:
cobra -ert:no -c hello
* But it doesn't work:
error: Metadata file "Cobra.Lang.dll" could not be found
* I tried again with verbosity cranked up:
cobra -ert:no -v:2 -c hello
Apparently, Cobra is able to locate and read the DLL and to generate code. It's the C# compilation that generates the error message.
* Reissuing with the C# compilation line gives the error message again. Axing the ".dll" of the "/r:Cobra.Lang.dll" gives the error message as well.
* I tried bypassing the CSharpCodeProvider, just to try something different, with:
cobra -ert:no -v:2 -sharp-compiler:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" -c hello
but got the same error message.
This was all done in a clean workspace.
So Cobra can seemingly locate the DLL from the GAC and read its contents. But C# compilation of the generated code chokes trying to read it regardless of whether we go through the code provider or invoke the compiler as an external command.
Any ideas?
-Chuck