Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
I've been having quite a few struggles with Visual Studio lately but I just can't fix this one out. When trying to rebuild my project I get:
Error CS0433: The type 'Func' exists in both 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
The only thing that seemed to work was to manually add a reference to the csproj file.
<Reference Include="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"/>
Which leaves me with a new error:
Error CS1703: Multiple assemblies with equivalent identity have been imported: 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll' and 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Remove one of the duplicate references.
Now the 3.5.0.0 reference is not found in the project but can be seen in the Object Browser with no option to remove it:
In an app.config file I also tried to redirect the reference to the newer version:
<dependentAssembly>
<assemblyIdentity name="System.Core" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="3.5.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
Which doesn't change a thing.
I'd appreciate any ideas or input as I've been searching and struggling with this for over a week.
–
–
–
Its such a pain to figure out this problem. After hitting my head for hours, finally I found the problem with the "3.5" version of system.core.dll.
So, I copied the "4.0.." version of "system.core.dll" from Program Files (X86) folder to my References or Bin folder of the Application. For me it was under(C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5).
Also, if needed, manually add a reference to the csproj file as mentioned in the Original Question.
Hope it helps. Sigh :)
–
open windows control panel > programs and features > turn windows features on or off, and disable .Net Framework 3.5.
video
this way works for me.
public delegate T MyFunc<T1, T>(T1 item);
public delegate T MyFunc<T1, T2, T>(T1 item1, T2 item2);
Thanks for contributing an answer to Stack Overflow!
Please be sure to answer the question. Provide details and share your research!
But avoid …
Asking for help, clarification, or responding to other answers.
Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.