Skip to content
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

The assembly 'Castle.Windsor [...] is not registered for COM Interop #604

Closed
FrancescoBonizzi opened this issue Oct 12, 2021 · 1 comment · Fixed by #611
Closed

The assembly 'Castle.Windsor [...] is not registered for COM Interop #604

FrancescoBonizzi opened this issue Oct 12, 2021 · 1 comment · Fixed by #611
Labels
Milestone

Comments

@FrancescoBonizzi
Copy link

FrancescoBonizzi commented Oct 12, 2021

Hi! I have a .NET library with Register for COM interop_attribute set to true, and COM visibile too in csproj. This library references Castle.Windsor 5.1.1 on .NET Framework 4.8, and when I build, I get this compiler error:

The assembly 'Castle.Windsor, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' is not registered for COM Interop. Please register it with regasm.exe /tlb.

I noticed that with other nuget libraries (for example Dapper 2.0.90) I don't have any problem to compile a dll registered for COM Interop. Is there something I'm missing? If I manually register the dll with regasm, it works, but I'm wondering why I have to do it manually!

Thanks a lot.

@jonorossi
Copy link
Member

Looks like it was broken when Windsor was moved to the .NET SDK project format and so the assembly is defaulting to COM visible.

CommonAssemblyInfo.cs doesn't have [assembly: ComVisible(false)] like Castle Core. ComVisible(false) used to be set via the MSBuild build scripts before the move.

@jonorossi jonorossi added the bug label Jan 11, 2022
Jevonius added a commit to Jevonius/Castle.Windsor that referenced this issue May 12, 2022
@jonorossi jonorossi added this to the v6.0 milestone May 14, 2022
jonorossi added a commit that referenced this issue Aug 2, 2022
Add `ComVisible(false)` to `CommonAssemblyInfo.cs` to resolve #604
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants