views:

20

answers:

0

Hi,

I'm attempting to run sgen.exe against a silverlight 4 assembly that I have created.

The command line is:

sgen.exe /a:"c:\MyPath\bin\Debug\myAsm.dll"

This command returns the following error:

Error: Unable to generate a temporary class (result=1).
error CS0433: The type 'System.Net.CookieContainer' exists in both 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll' and 'c:\MyPath\bin\Debug\System.Net.dll'

All the references used by myAsm.dll are copied locally into the Debug folder alongside it. There is a System.dll and a System.Net.dll in the Debug folder both of which are, as you would expect, the appropriate Silverlight versions.

1) I do not understand why sgen is attempting to use anything from the GAC. Does the GAC contain Silverlight assemblies? I didn't think it did.

2) How do I force sgen to use the local silverlight references rather than the GAC?

Re point 2, I have attempted to use compiler options to force the references.

I attempted the following command line (called from within the debug folder):

sgen.exe /compiler:"/reference:system.dll" /a:myAsm.dll

This resulted in the following error:

Error: Unable to generate a temporary class (result=1).
error CS1703: An assembly with the same identity 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' has already been imported. Try removing one of the duplicate references.