sdk
sdk copied to clipboard
Can't use .NET CLI to build .vbproj with resources
Steps to reproduce
Build https://github.com/dotnet/docs/blob/cb0436d1b37f4e76c33fc6e6f6c8b7f48f062a5d/samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.resources.locating/vb/locatingvb1.vbproj
Actual behaviors
When using Visual Studio the project builds successfully.
When using dotnet build a generated .resources.cs file fails the build.
See the complete build output in https://github.com/dotnet/docs/pull/20145/checks?check_run_id=996406977.
##[error]obj\Debug\net48\en-us\LocatingVB1.resources.cs(13,30): error CS0234: The type or namespace name 'AssemblyCompanyAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [D:\a\docs\docs\samples\snippets\visualbasic\VS_Snippets_CLR\conceptual.resources.locating\vb\locatingvb1.vbproj]
##[error]obj\Debug\net48\en-us\LocatingVB1.resources.cs(13,30): error CS0234: The type or namespace name 'AssemblyCompanyAttributeAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [D:\a\docs\docs\samples\snippets\visualbasic\VS_Snippets_CLR\conceptual.resources.locating\vb\locatingvb1.vbproj]
##[error]obj\Debug\net48\en-us\LocatingVB1.resources.cs(13,55): error CS0518: Predefined type 'System.String' is not defined or imported [D:\a\docs\docs\samples\snippets\visualbasic\VS_Snippets_CLR\conceptual.resources.locating\vb\locatingvb1.vbproj]
Environment data
.NET SDK (reflecting any global.json):
Version: 5.0.100-preview.6.20318.15
Commit: 4356580024
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19041
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.100-preview.6.20318.15\
Host (useful for support):
Version: 5.0.0-preview.6.20305.6
Commit: 4ba9ecaabd
.NET SDKs installed:
3.1.400 [C:\Program Files\dotnet\sdk]
5.0.100-preview.6.20318.15 [C:\Program Files\dotnet\sdk]
Did you find a fix for your issue?
This has been fixed as of .NET 8.