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
Build error for any type generated by CsWin32, if a referenced assembly also contains the type as internal! Example error:
error CS0122: 'HRESULT' is inaccessible due to its protection level.
Expected behavior
When using any type from CsWin32 that is generated into the local assembly - even if the type also exist in a referenced assembly - I am expecting the generated type to be used.
I also tried building outside Visual Studio using dotnet build. This command successfully builds the project. Then I added the following piece to the project and tested again. This time also dotnet build fails similarly.
I guess the source generator has logic to detect if the type already exists, but it does not distinguish between type exist in the current assembly or a referenced one or this logic doesn't work when directly building with MSBuild and only via dotnet build.
Actual behavior
Build error for any type generated by CsWin32, if a referenced assembly also contains the type as internal! Example error:
Expected behavior
When using any type from CsWin32 that is generated into the local assembly - even if the type also exist in a referenced assembly - I am expecting the generated type to be used.
Repro steps
NativeMethods.txtcontent:NativeMethods.jsoncontent (if present): Not presentAny of your own code that should be shared?
Context
LangVersion(if explicitly set by project): 13.0The repo can be found below:
Note
I suggest downloading this single project (not the entire solution) to easily build:
https://github.com/rezanid/xrmtools/blob/vsix-hybrid/src/XrmTools.Shell/XrmTools.Shell.csproj
Additional Context
I also tried building outside Visual Studio using
dotnet build. This command successfully builds the project. Then I added the following piece to the project and tested again. This time alsodotnet build failssimilarly.I guess the source generator has logic to detect if the type already exists, but it does not distinguish between type exist in the current assembly or a referenced one or this logic doesn't work when directly building with MSBuild and only via
dotnet build.