Skip to content

Commit 7dc270d

Browse files
[build] set $(ProduceReferenceAssemblyInOutDir)=True (#949)
Context: https://docs.microsoft.com/dotnet/core/compatibility/sdk/6.0/write-reference-assemblies-to-obj Context: dotnet/msbuild#7355 Using the latest internal builds of Visual Studio, you hit the build error when building xamarin-android: build-tools\create-packs\Directory.Build.targets(28,5): error MSB4018: The "CreateFrameworkListFile" task failed unexpectedly. [build-tools\create-packs\Microsoft.Android.Ref.proj] build-tools\create-packs\Directory.Build.targets(28,5): error MSB4018: System.IO.DirectoryNotFoundException: Could not find a part of the path 'external\Java.Interop\bin\Debug-net6.0\ref\Java.Interop.dll'. This was a breaking change in MSBuild: > ### Old behavior > Since reference assemblies were added, the .NET SDK has written > reference assemblies to the `ref` directory in the `OutDir` > directory of the compilation. > > ### New behavior > Now, reference assemblies are written to the `refint` directory of > the `IntermediateOutputPath` directory by default, like many other > intermediate artifacts. > > ### Reason for change > Reference assemblies are generally not run-time assets, and so don't > belong in the `OutDir` directory by default. Since we *are* using the reference assembly as build output, I think we *should* put the file in `bin`. Let's set `$(ProduceReferenceAssemblyInOutDir)`=True to get the old behavior. After this change goes in, we'll need other changes in xamarin/xamarin-android. We might also be able to use `$(TargetRefPath)` in some way, but that isn't needed here.
1 parent f91b077 commit 7dc270d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<TreatWarningsAsErrors Condition=" '$(Configuration)' == 'Release' And '$(MSBuildRuntimeType)' != 'Mono' ">true</TreatWarningsAsErrors>
88
<_OutputPath>$(MSBuildThisFileDirectory)bin\Build$(Configuration)\</_OutputPath>
99
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
10+
<ProduceReferenceAssemblyInOutDir>true</ProduceReferenceAssemblyInOutDir>
1011
</PropertyGroup>
1112

1213
<PropertyGroup>

0 commit comments

Comments
 (0)