Fix F5 experience in VS for crossgen2 (dotnet/coreclr#27104)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Wed, 9 Oct 2019 19:24:10 +0000 (21:24 +0200)
committerGitHub <noreply@github.com>
Wed, 9 Oct 2019 19:24:10 +0000 (21:24 +0200)
Ever since dotnet/coreclr#26792 I wasn't able to F5 launch the crossgen2 project from the src\tools\crossgen2\crossgen2.sln solution. I tried git clean, updating VS, etc. until I convinced myself this is really broken for everyone.

The error was:

```
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '3.0.0' was not found.
  - No frameworks were found.
```

I narrowed this down to the various json config file gunk. Not generating the json file gunk makes the old setup work again. We likely don't need the crossgen2/libs hack anymore either.

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

src/coreclr/src/tools/crossgen2/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj
src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj
src/coreclr/src/tools/crossgen2/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj
src/coreclr/src/tools/crossgen2/crossgen2/crossgen2.csproj

index 3ac648b..c0df1df 100644 (file)
@@ -7,8 +7,13 @@
     <TargetFramework>netstandard1.3</TargetFramework>
     <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
     <Platforms>x64;x86</Platforms>
-    <OutputPath>$(BinDir)/crossgen2/libs</OutputPath>
     <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
+
+    <!-- We're binplacing these into an existing publish layout so that F5 build in VS updates
+         the same bits tests expect to see in bin/crossgen2. That way we never need to wonder which
+         binaries are up to date and which are stale. -->
+    <OutputPath>$(BinDir)/crossgen2</OutputPath>
+    <GenerateDependencyFile>false</GenerateDependencyFile>
   </PropertyGroup>
   <ItemGroup>
     <PackageReference Include="System.Xml.ReaderWriter">
index 87bfdf3..91a2515 100644 (file)
@@ -9,8 +9,13 @@
     <DefineConstants>READYTORUN;$(DefineConstants)</DefineConstants>
     <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
     <Platforms>x64;x86</Platforms>
-    <OutputPath>$(BinDir)/crossgen2/libs</OutputPath>
     <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
+
+    <!-- We're binplacing these into an existing publish layout so that F5 build in VS updates
+         the same bits tests expect to see in bin/crossgen2. That way we never need to wonder which
+         binaries are up to date and which are stale. -->
+    <OutputPath>$(BinDir)/crossgen2</OutputPath>
+    <GenerateDependencyFile>false</GenerateDependencyFile>
   </PropertyGroup>
   
   <ItemGroup>
index 0598bb9..610d9ce 100644 (file)
@@ -9,8 +9,13 @@
     <TargetFramework>netstandard1.3</TargetFramework>
     <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
     <Platforms>x64;x86</Platforms>
-    <OutputPath>$(BinDir)/crossgen2/libs</OutputPath>
     <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
+
+    <!-- We're binplacing these into an existing publish layout so that F5 build in VS updates
+         the same bits tests expect to see in bin/crossgen2. That way we never need to wonder which
+         binaries are up to date and which are stale. -->
+    <OutputPath>$(BinDir)/crossgen2</OutputPath>
+    <GenerateDependencyFile>false</GenerateDependencyFile>
   </PropertyGroup>
   <ItemGroup>
     <PackageReference Include="System.IO.MemoryMappedFiles">
index e1d1e9c..7801af7 100644 (file)
@@ -8,8 +8,14 @@
     <TargetFramework>netcoreapp3.0</TargetFramework>
     <NoWarn>8002,NU1701</NoWarn>
     <Platforms>x64;x86</Platforms>
-    <OutputPath>$(BinDir)/crossgen2</OutputPath>
     <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
+
+    <!-- We're binplacing these into an existing publish layout so that F5 build in VS updates
+         the same bits tests expect to see in bin/crossgen2. That way we never need to wonder which
+         binaries are up to date and which are stale. -->
+    <OutputPath>$(BinDir)/crossgen2</OutputPath>
+    <GenerateDependencyFile>false</GenerateDependencyFile>
+    <GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>
   </PropertyGroup>
 
   <ItemGroup>