VS migrating from 2005 to 2010, LNK1316: duplicate managed resource name

1.3k views Asked by At

i'm migrating C++ .NET solution from vs 2005 to vs 2010 i receive in managed project a linker error: LINK : fatal error LNK1316: duplicate managed resource name\

thanks for your help

3

There are 3 answers

0
Nathan DeWitt On

Looks like a bug in Visual Studio 2010. In this case, it was

an issue with project system not removing the extra Form2.resx that you change the form2.h from header type to Winform type.

I suggest going through your solution to see if you have any resources that should be removed when file types are changed. They said they might fix it in an updated version, but since the workaround is so easy (delete the file) they aren't going to worry about it.

9
AntonyW On

Is it this? :

Link...

EDIT: I'll summarise the answer below to save reading all the comments :

When VS2010 converted the project file from VS2005, it found a macro $(InputName) which is no longer used. It replaces it with %FILENAME. To fix this problem, go to Properties, Managed Resource, Resource Logical Name and change it to %(FileName).

0
Alexander On

I also had the same problem, but replacing $(InputName) to $(FileName) or $(ProjectName) did not help. What helped was moving the resource file to the project root directory and leaving the "Resource Logical Name" blank in Properties->Managed Resources->General.