Skip to content

BC2017: could not find library 'Microsoft.VisualBasic.dll' while building VB app with VBRuntime set to Default #76931

Open
@Ingvarr100th

Description

@Ingvarr100th

Version Used: 4.12.0-3.24631.1 (da7c6c4)

Steps to Reproduce:

  1. Create new VB.NET Project targeted to .NET 9
  2. Add <VBRuntime>Default</VBRuntime> to <PropertyGroup> in .vbproj
  3. Use something from My namespace eg.: My.Computer

Project file:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net9.0</TargetFramework>
    <OutputType>Exe</OutputType>
    <RootNamespace>TestApp</RootNamespace>
    <VBRuntime>Default</VBRuntime>
  </PropertyGroup>
</Project>

Program VB:

Module Program
    Sub Main(args As String())
        Console.WriteLine(My.Computer.Info.OSVersion)
    End Sub
End Module

Expected Behavior:

The app is building.

Actual Behavior:

IntelliSense detects:
BC30456 'Computer' is not a member of 'TestApp.My'.

1>------ Build started: Project: TestApp, Configuration: Debug Any CPU ------
1>vbc : error BC2017: could not find library 'Microsoft.VisualBasic.dll'
1>Done building project "TestApp.vbproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Additional info:
The .NET 9 SDK that I used came with VS2022 Enterprise (17.12.4)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-CompilersuntriagedIssues and PRs which have not yet been triaged by a lead

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions