Make ILProj work in Visual Studio (dotnet/coreclr#23264)
authorEric StJohn <ericstj@microsoft.com>
Fri, 15 Mar 2019 02:13:11 +0000 (19:13 -0700)
committerGitHub <noreply@github.com>
Fri, 15 Mar 2019 02:13:11 +0000 (19:13 -0700)
CPS depends the targets defined here and will fail to load a project if these aren't imported.

Commit migrated from https://github.com/dotnet/coreclr/commit/fa43509b42083ba044660d7ea566af79207a4275

src/coreclr/src/.nuget/Microsoft.NET.Sdk.IL/targets/Microsoft.NET.Sdk.IL.targets

index cea740d..816ccd8 100644 (file)
@@ -146,6 +146,13 @@ Copyright (c) .NET Foundation. All rights reserved.
     <CallTarget Targets="$(TargetsTriggeredByCompilation)" Condition="'$(TargetsTriggeredByCompilation)' != ''"/>
   </Target>
 
+  <!-- Import design time targets for Roslyn Project System. These are only available if Visual Studio is installed. -->
+  <!-- Required for project to load in Visual Studio. -->
+  <PropertyGroup>
+    <ManagedDesignTimeTargetsPath Condition="'$(ManagedDesignTimeTargetsPath)'==''">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\Managed\Microsoft.Managed.DesignTime.targets</ManagedDesignTimeTargetsPath>
+  </PropertyGroup>
+  <Import Project="$(ManagedDesignTimeTargetsPath)" Condition="'$(ManagedDesignTimeTargetsPath)' != '' and Exists('$(ManagedDesignTimeTargetsPath)')" />
+
   <Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
 
 </Project>