You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem occurs with the Assembly resources that can be created by default in a new visual basic project. The following ItemGroup is created for the assembly default resource:
Create a new project for visual basic using the following command line instructions in any empty directory:
dotnet new sln --name Test ;
dotnet new classlib --language VB --framework net8.0-o ClassLib
dotnet sln add .\ClassLib\ClassLib.vbproj
dotnet add .\ClassLib\ClassLib.vbproj package Microsoft.CodeAnalysis.ResxSourceGenerator --version 3.11.0-beta1.24454.1
Open the newly created solution "Test.sln" in Visual Studio
Right click "ClassLib" in the Solution Explorer and select "Properties" at the very bottom.
Scroll to the very bottom of the opened page to the "resources" section and click the link to create or open the assembly resources
Enable "View all files" in the solution explorer
Find the file "My Project" → Resources.resx → Resources.Designer.vb
Compile everything
Once you do that, you'll get the error:
1>…\ClassLib\obj\Debug\net8.0\Microsoft.CodeAnalysis.ResxSourceGenerator.VisualBasic\Microsoft.CodeAnalysis.ResxSourceGenerator.VisualBasic.VisualBasicResxGenerator\Resources.Designer.vb(6,30): error BC30205: End of statement expected.
Expected behavior
Ideally the source generator picks up the <CustomToolNamespace> and uses it for the namespace part in addition to the RootNamespace.
The expected header for the generated class file is:
The source generator differs in some more points compared to the VbMyResourcesResXFileCodeGenerator. The "old" file generator creates a "Module" instead of a class with some additional properties. There does not seem to be a way for the new source generator to do the same thing.
The text was updated successfully, but these errors were encountered:
Analyzer
Diagnostic ID: Does not apply -
Microsoft.CodeAnalysis.ResxSourceGenerator
Analyzer source
NuGet Package: Microsoft.CodeAnalysis.ResxSourceGenerator
Version: 3.11.0-beta1.24454.1
Describe the bug
The problem occurs with the Assembly resources that can be created by default in a new visual basic project. The following
ItemGroup
is created for the assembly default resource:The problem in the generated resource file is the directory of this resource file. The source generated starts like this:
This is a syntax error when compiling the source.
Steps To Reproduce
Once you do that, you'll get the error:
Expected behavior
Ideally the source generator picks up the
<CustomToolNamespace>
and uses it for the namespace part in addition to theRootNamespace
.The expected header for the generated class file is:
Actual behavior
The current output is:
With "My Project" being a syntax error.
Additional context
The source generator differs in some more points compared to the
VbMyResourcesResXFileCodeGenerator
. The "old" file generator creates a "Module" instead of a class with some additional properties. There does not seem to be a way for the new source generator to do the same thing.The text was updated successfully, but these errors were encountered: