-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release reference assemblies break overload resolution in VB on .NET Framework 4.7.2 #51711
Comments
This is because of the following target in the 1.0.0 version of the package 1.0.0 <ItemGroup Condition=" ('$(TargetFrameworkIdentifier)' == '.NETFramework') And ('$(TargetFrameworkVersion)' == 'v4.7.2') ">
<Reference Include="mscorlib" Pack="false" />
<Reference Include="Microsoft.VisualBasic" Pack="false"
Condition="'$(Language)' == 'VB' And '$(UsingMicrosoftNETSdk)' == 'true'" />
</ItemGroup> 1.0.0-preview1 <ItemGroup Condition=" ('$(TargetFrameworkIdentifier)' == '.NETFramework') And ('$(TargetFrameworkVersion)' == 'v4.7.2') ">
<Reference Include="mscorlib" Pack="false" />
</ItemGroup> Essentially the 1.0.0 RTM forces the reference of MS.VB.dll which my instinct says is the wrong behavior here. That should not be controlled at this level, rather it should be controlled by the underlying SDK. In either case though the fix is very simple: the identifier just needs to be renamed from Do feel like there are two outcomes here:
I'm unsure where the bug for (2) should filed though. @dsplaisted do you know? |
See dotnet/installer#3228 for why we added the Microsoft.VisualBasic reference. I think that there is some weirdness with the VB Runtime that meant we felt this was the best solution. |
@dsplaisted how do we setup a VB project that does not reference Microsoft.VisualBasic.dll? I think that is one part that often gets overlooked in these types of changes. While referencing Microsoft.VisualBasic.dll is expected for most VB projects, and should be the implicit default, it's by no means required. |
Compile project
src/Compilers/Test/Utilities/VisualBasic/Microsoft.CodeAnalysis.VisualBasic.Test.Utilities.vbproj
fornet472
with the following package reference added:With the following command
You will get the following compiler errors:
See binlogs here:
logs.zip
The only major change I can see between the working and non-working commandlines is that Microsoft.VisualBasic.dll is passed in as a reference in the non-working case.
full commandline diff
The text was updated successfully, but these errors were encountered: