Disable the project migration dialog when opening a SharePoint 2010 project

We must develop for SharePoint 2013 and SharePoint 2010 at the same time, so I installed Windows Server 2012 on my computer with SharePoint 2013 installed because of compatibility with SharePoint 2013.

When I open a solution containing SharePoint 2010 projects with Visual Studio 2012 (with Office 2013 developer tools installed), every time I get this nasty dialog:

Migration migration

and after clicking "No", a migration report opens in my browser. In addition, the .csproj file gets a checkbox, and the FileUpgradeFlags element gets a value of 40 .

Appart due to the fact that it is very annoying (especially when opening very large solutions), checking the project file and the value of FileUpgradeFlags is a problem with random checking, because then all my colleagues are still working with Windows 7 and SharePoint 2010 will display a different dialog migration after opening the corresponding solution.

Does anyone encounter this behavior and perhaps know a way to turn off the migration dialog and register project files?

We need SharePoint 2010 projects to stay that way.

Thanks in advance!

+4
source share
1 answer

I found how to manage this. Update the .csproj file for the SP 2010 project. Install

 <TargetOfficeVersion>15.0</TargetOfficeVersion> 

So, now he will not ask you for migration when you open the SP 2013 machine. But you cannot build the project on the 2010 machine. Therefore, you can put the following code in the .csproj.user file:

  <PropertyGroup> ... <TargetOfficeVersion>14.0</TargetOfficeVersion> </PropertyGroup> 

A version control system (such as SVN or Git) is usually configured to ignore .csproj.user files. Therefore, if this file is not ignored by the version control system, add it to the ignore list.

What is it. Everyone who opens a project on an SP 2013 machine will not see the migration dialog. Everyone who needs to work in SP 2010 just updates the .csproj.user file.

+3
source

Source: https://habr.com/ru/post/1485800/


All Articles