Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF error CS0433

Tags:

.net

wpf

sgen

I'm getting this error in my WPF application. I get this error not always. If I make Clean and then Rebuild everything is ok.

SGEN (0,0):                                             
error: Unable to generate a temporary class (result=1).

SGEN (0,0):
errorCS0433: The type 'XamlGeneratedNamespace.GeneratedInternalTypeHelper' exists in both 'library1.dll' and 'library2.dll'
like image 527
Pashec Avatar asked Oct 01 '10 20:10

Pashec


2 Answers

You could use RummageTypeRenamer, a free tool bundled with our obfuscator Rummage (I work for Aldaray), to rename the GeneratedInternalTypeHelper type to something else.

We rename it to something like GeneratedInternalTypeHelper$(ProjectName) so that it is unique across projects and never clashes. We do that in all our build scripts to get ILMerge to work (blog entry in my colleague’s private blog).

like image 151
Timwi Avatar answered Oct 22 '22 04:10

Timwi


Here's an article by Scott Hanselman discussing this issue for WPF.

Other people that have had this problem have fixed it by installing some hotfixes. Check out this article for more information.

If you're using Citrix, you might want to check this out. You could have a permissions issue. This particular article deals with an ASP .NET application, but you might have a similar issue in your WPF application. It's a good place to start.

like image 1
Robert Greiner Avatar answered Oct 22 '22 03:10

Robert Greiner