Open rmotta01 opened 1 year ago
Hey there, thanks for this! Good to see a Visual Basic fan! To be honest I'm not sure if this scenario is supported right now.
In either case, this is going deeper than .NET MAUI, so I will move this one to the iOS repository. Probably they will know more about it there. Thanks!
This issue was moved to xamarin/xamarin-macios#17017
Reopening due to: https://github.com/xamarin/xamarin-macios/issues/17017#issuecomment-1348518302
@jfversluis actually I think this is an issue in MAUI, a plain net7.0-ios project with a VB-reference (netstandard2.0) works just fine.
The problem is here:
This will run the
GetMauiItems
target in all referenced projects, passingTargetFramework=net7.0-ios
- effectively overriding theTargetFramework=netstandard2.0
in the vbproj project file. So you're forcing the vbproj to be built as if it were anet7.0-ios
project (which doesn't work).
Verified this issue with Visual Studio Enterprise 17.6.0.1575. Can repro on iOS and macOS platform with sample project. MauiBugVbClassLib-master.zip
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