On a machine without the .NET Framework 4.5 targeting pack installed:
Create a project like this and do dotnet build
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net45</TargetFramework>
<VBRuntime>Default</VBRuntime>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.2" />
</ItemGroup>
</Project>
Expected: Build succeeds
Actual: Build fails with
vbc : error BC2017: could not find library 'Microsoft.VisualBasic.dll'
The problem is that NETFramework.ReferenceAssemblies does not cause $(FrameworkPathOverride) which is passed to vbc to have the targeting pack folder.
Also, It is setting EnableFrameworkPathOverride to false, but that seems to be after FrameworkPathOverride is already set and not having the fully intended effect so this does work when the targeting pack is installed.
cc @dsplaisted
On a machine without the .NET Framework 4.5 targeting pack installed:
Create a project like this and do
dotnet buildExpected: Build succeeds
Actual: Build fails with
The problem is that NETFramework.ReferenceAssemblies does not cause $(FrameworkPathOverride) which is passed to vbc to have the targeting pack folder.
Also, It is setting EnableFrameworkPathOverride to false, but that seems to be after FrameworkPathOverride is already set and not having the fully intended effect so this does work when the targeting pack is installed.
cc @dsplaisted