Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ComWrappersGeneration fails to build #7018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
f-rich opened this issue Feb 13, 2025 · 2 comments · Fixed by #7038
Closed

ComWrappersGeneration fails to build #7018

f-rich opened this issue Feb 13, 2025 · 2 comments · Fixed by #7038

Comments

@f-rich
Copy link

f-rich commented Feb 13, 2025

Pulled the latest code for the ComWrappersGeneration solution from main, it doesn't build out-the-box:

  • dotnet\samples\core\interop\source-generation\ComWrappersGeneration\Server\bin\Generated\dnne-analyzers\DNNE.AttributesGenerator\DnneAttributes.g.cs(40,27,40,47): error CS0101: The namespace 'DNNE' already contains a definition for 'C99DeclCodeAttribute'
  • dotnet\samples\core\interop\source-generation\ComWrappersGeneration\Server\bin\Generated\dnne-analyzers\DNNE.AttributesGenerator\DnneAttributes.g.cs(59,27,59,43): error CS0101: The namespace 'DNNE' already contains a definition for 'C99TypeAttribute'
  • dotnet\samples\core\interop\source-generation\ComWrappersGeneration\Server\Exports.cs(19,42,19,63): error CS0121: The call is ambiguous between the following methods or properties: 'C99TypeAttribute.C99TypeAttribute(string)' and 'C99TypeAttribute.C99TypeAttribute(string)'
  • dotnet\samples\core\interop\source-generation\ComWrappersGeneration\Server\Exports.cs(19,81,19,102): error CS0121: The call is ambiguous between the following methods or properties: 'C99TypeAttribute.C99TypeAttribute(string)' and 'C99TypeAttribute.C99TypeAttribute(string)'
  • dotnet\samples\core\interop\source-generation\ComWrappersGeneration\Server\bin\Generated\dnne-analyzers\DNNE.AttributesGenerator\DnneAttributes.g.cs(65,16,65,32): error CS0111: Type 'C99TypeAttribute' already defines a member called 'C99TypeAttribute' with the same parameter types
  • dotnet\samples\core\interop\source-generation\ComWrappersGeneration\Server\bin\Generated\dnne-analyzers\DNNE.AttributesGenerator\DnneAttributes.g.cs(46,16,46,36): error CS0111: Type 'C99DeclCodeAttribute' already defines a member called 'C99DeclCodeAttribute' with the same parameter types`

FYI, if I fudge the namespace (just to get something built) then I also get the following warnings:

  • Server.g.obj : warning LNK4104: export of symbol 'DllGetClassObject' should be PRIVATE
  • Server.g.obj : warning LNK4104: export of symbol 'DllRegisterServer' should be PRIVATE
  • Server.g.obj : warning LNK4104: export of symbol 'DllUnregisterServer' should be PRIVATE

They are marked as private in server.def so this warning seems erroneous? Also, surely you wouldn't want them as private as regsvr32 would then fail to find the entry points? (as it stands regsvr32 fails anyway because it can't find them!)

Has anyone actually tried building/running this sample?!

@f-rich
Copy link
Author

f-rich commented Feb 14, 2025

(on the private exports point - I'd forgotten that COM finds the entry points via a different mechanism so private is actually correct)

@f-rich
Copy link
Author

f-rich commented Apr 10, 2025

Any thoughts, @jtschuster @AaronRobinsonMSFT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant