4

I have a solution in with project in C#, C++/CLI targeted to .NET 4 and with some dependencies in .NET4. When I open this solution in Visual Studio 2013 it prompts for upgrading the solution. Some developers in our remote teams don't read the messagebox and just press OK. The dependencies are not compatible after project upgrade and then they are mailing me that the solution cannot be built.

upggradeVCplusplus

Is there some way to turn off this prompts for .NET Framework upgrade?

Tomas Kubes
  • 23,880
  • 18
  • 111
  • 148
  • No. It is not the problem anyway, converting the projects to the VS2013 format does not change the framework target. You have not researched this problem well enough. Intentionally omitting any kind of diagnostic message doesn't help us help you either. – Hans Passant Aug 05 '16 at 11:11
  • VS2013 only try to update the project file ".csproj" and not the target framework. Target framework is still the same. –  Aug 05 '16 at 11:12
  • I assume the main problem is with the c++/CLI project (where upgrading the major version of the c++ compiler always results in new errors) - even if you disable the prompts so that careless programmers don't upgrade it, what's to stop them manually upgrading compiler settings and checking it in? That seems to be the underlying problem. Communicate with your team and have them revert their change. Also [VS2010 SP1+ is forward compatible](http://stackoverflow.com/a/31600348/585968) –  Aug 05 '16 at 11:16
  • 1
    I add the upgrade message to make it clear. Yes, the problem is caused by C++/CLI project. – Tomas Kubes Aug 05 '16 at 11:48
  • Thanks. Yeah definitely don't want to upgrade. –  Aug 05 '16 at 23:16

1 Answers1

9

Put the following line in the global property section of your project file.

<VCProjectUpgraderObjectName>NoUpgrade</VCProjectUpgraderObjectName>

in context:

<PropertyGroup Label="Globals">
    ...
    <VCProjectUpgraderObjectName>NoUpgrade</VCProjectUpgraderObjectName>
</PropertyGroup>

Works for Visual Studio 2015 & 2017 as well.

You will need to remove it when you want to do the upgrade.

Source: https://blogs.msdn.microsoft.com/dsvc/2015/12/13/migration-from-vs2012-to-vs2015-ide-only-throws-compiler-upgrade-warning/

Joe Schrag
  • 855
  • 8
  • 23