VisualStudio 2013 Create a console project. NETFramework is selected as 4.5. Build target platform: x64. Then add a reference to the Microsoft.SharePoint.dll.
When you build the project,the Error List reports the following warning:
There is a conflict between different versions of the same dependent assembly found. Please set the "Autogeneratebindingredirects" property in the project file to True. For more information, see http://go.microsoft.com/fwlink/?LinkId=294190.
Also, in the Output window:
1>------started rebuild All: project: createtestfilesproj, config: Debug any CPU------
1> cannot solve "Microsoft.SharePoint.Security, version=15.0.0.0, Culture=neutral, publickeytoken=71e9bce111e9429c" and " The conflict between Microsoft.SharePoint.Security, version=14.0.0.0, Culture=neutral, publickeytoken=71e9bce111e9429c ". are at liberty to choose "Microsoft.SharePoint.Security, version=15.0.0.0, Culture=neutral, publickeytoken=71e9bce111e9429c".
1> please consider using App. config to set the assembly "Microsoft.SharePoint.Security, Culture=neutral, publickeytoken=71e9bce111e9429c" from version 14.0.0.0 "[] Remap to Version" 15.0.0.0 "[C:\Program files\common files\microsoft Shared\Web Server Extensions\15\isapi\ Microsoft.SharePoint.Security.dll] To resolve the conflict and eliminate the warning.
1>c:\program Files (x86) \msbuild\12.0\bin\microsoft.common.currentversion.targets (1635,5): Warning MSB3276: There is a conflict between different versions of the same dependent assembly found. Please set the "Autogeneratebindingredirects" property in the project file to True. For more information, see http://go.microsoft.com/fwlink/?LinkId=294190.
1> Createtestfilesproj-C:\Code\Demo\CreateTestFilesProj\bin\Debug\CreateTestFilesProj.exe
========== All rebuilds: 1 successful, 0 failed, 0 ========== skipped
Workaround:
In fact, the warning has been prompted, that is, in the project file set autogeneratebindingredirects to True.
Right-click the project, select Unload Project, and then right-click the unloaded project and select Edit Xxxx.csproj.
To modify the project to:
Once done, save, then reload the project, build again, perfect solution.
?
Reference:
Http://www.cnblogs.com/zoro-zero/p/5867320.html
Http://www.cnblogs.com/xwgli/p/3617645.html
?
Unable to resolve the conflict between "Microsoft.SharePoint.Security, version=15.0.0.0," and "Microsoft.SharePoint.Security, version=14.0.0.0"