Skip to content

Select appropriate VB runtime by default#3415

Merged
nguerrera merged 3 commits into
dotnet:masterfrom
nguerrera:vb-runtime
Jul 16, 2019
Merged

Select appropriate VB runtime by default#3415
nguerrera merged 3 commits into
dotnet:masterfrom
nguerrera:vb-runtime

Conversation

@nguerrera

Copy link
Copy Markdown
Contributor

Fix #3387
Fix #2793

This comment in the code describes and documents the approach:

By default, VBRuntime is chosen as follows:

    .NET Framework:
      Same as classic vbproj. $(FrameworkPathOverride) is passed  as
      /sdkpath to compiler and Microsoft.VisualBasic.dll will be used
      from there even if there is no explicit reference to it. This is
      accomplished by leaving $(VBRuntime) unset.

    .NET Core 3.0+:
      Locate Microsoft.VisualBasic among references and pass it as
      /vbruntime to compiler.

    .NET Core < 3.0 or .NET Standard:
      Use embedded VB runtime as there is no Microsoft.VisualBasic.dll
      available that is complete enough to serve as /vbruntime.

   These defaults can be overridden as follows:

    $(UseReferencedVBRuntime) == true:
      Use referenced Microsoft.VisualBasic regardless of TFM.

      This is an escape hatch for a custom Microsoft.VisualBasic reference
      that can work as /vbruntime on a target framework other than .NET Core 3.0+

    $(VBRuntime) != '':
      Pass it through to compiler unchanged.

@nguerrera nguerrera requested review from a team, KathleenDollard and cston July 12, 2019 22:01
@livarcocc livarcocc added this to the 3.0.1xx milestone Jul 12, 2019
Comment thread src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToUseVB.cs Outdated
Comment thread src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.VisualBasic.targets Outdated
@nguerrera

Copy link
Copy Markdown
Contributor Author

@livarcocc @dotnet/dotnet-cli Can I get some eyes on changes since review:

  1. force push to use TestProject instead of TestAsset, with the goal of making the test work x-plat by using Microsoft.NETFramework.ReferenceAssemblies.

  2. 0e26306 to disable the net45 test when net45 targeting pack is not installed because of Microsoft.NETFramework.ReferenceAssemblies does not find VB runtime installer#3228, which meant that (1) didn't actually work.

@nguerrera

Copy link
Copy Markdown
Contributor Author

Sigh, one more adjustment for x-plat: 2523163

I'll wait for this to actually turn green before asking for a final review. :)

@nguerrera nguerrera merged commit c5c50dd into dotnet:master Jul 16, 2019
@nguerrera nguerrera deleted the vb-runtime branch July 16, 2019 20:43
dsplaisted pushed a commit to dsplaisted/sdk that referenced this pull request Feb 19, 2020
….1 (dotnet#3415)

- Microsoft.DotNet.Cli.Runtime - 3.1.100-preview3.19551.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VB.NET "My" not working as expected? Result of chr() cannot be used as initial value of a Const in .Net Core 3 Preview 1

2 participants