dotnet / dotnet/maui

.NET MAUI App build fails when project references Visual Basic netstandard2.0 or net7.0 library

Open
#11,997 6 comments 0 reactions 0 assignees View on GitHub
area-single-project blocked platform/ios platform/macos s/triaged s/verified t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 15h
Merged PRs (30d)
290

Description

### Description

Build fails for iOS and Mac when a Maui project references a Visual Basic netstandard2.0 or net7.0 library.

1>------ Build started: Project: MauiBugVbClassLib, Configuration: Debug Any CPU ------
1>C:\Program Files\dotnet\packs\Microsoft.MacCatalyst.Sdk\15.4.2372\targets\Xamarin.Shared.Sdk.targets(1916,2): error MSB4019: The imported project "C:\Program Files\dotnet\packs\Microsoft.MacCatalyst.Sdk\15.4.2372\tools\msbuild\MacCatalyst\Xamarin.MacCatalyst.VB.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files\dotnet\packs\Microsoft.MacCatalyst.Sdk\15.4.2372\\tools\msbuild\MacCatalyst\Xamarin.MacCatalyst.VB.targets" is correct, and that the file exists on disk.
1>Done building project "ClassLibrary1.vbproj" -- FAILED.

1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.0.1478\targets\Xamarin.Shared.Sdk.targets(1904,2): error MSB4019: The imported project "C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.0.1478\tools\msbuild\iOS\Xamarin.iOS.VB.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.0.1478\\tools\msbuild\iOS\Xamarin.iOS.VB.targets" is correct, and that the file exists on disk.
1>Done building project "ClassLibrary1.vbproj" -- FAILED.

### Steps to Reproduce

Add a reference to a VB netstandard2.0 or net7.0 library.
Build.

### Link to public reproduction project repository

https://github.com/rmotta01/MauiBugVbClassLib

### Version with bug

7.0 (current)

### Last version that worked well

Unknown/Other

### Affected platforms

iOS, macOS

### Affected platform versions

ios 11, maccatalyst 13.1

### Did you find any workaround?

_No response_

### Relevant log output

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the public reproduction repository and build the MauiBugVbClassLib project for iOS and MacCatalyst. Inspect the reported Xamarin.iOS.VB.targets and Xamarin.MacCatalyst.VB.targets imports in the SDK build output. Done means the MAUI project can reference the Visual Basic netstandard2.0 or net7.0 library and build successfully for both platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, macos, visualbasic
Domain
build-system, desktop, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.