Is anyone successfully using registration-free COM with .NET components?
Asked Answered
P

3

21

Until recently, we were happily using registration-free COM for our native and .NET COM components. However, we ran into a weird issue where our application started crashing randomly on windows XP SP3 (but not on vista) after we only changed the version number of a .NET assembly to move from release candidate to release. (Don't you just hate Murphy's law?)

After many a lost man-day and teeth grinding, we discovered that the issue was a known bug in sxs.dll which causes heap corruption when retrieving information about a .NET class. There is a hot-fix which makes the issue disappear but hot-fixes are not intended to be redistributed.

We're kinda stumped that there is such a horrible bug in the registration-free COM implementation. Is anyone out there successfully using registration-free COM for .NET components? How did you work around this issue?

Putnem answered 6/3, 2009 at 0:10 Comment(3)
+1 important issue which I was not aware of! BTW can I suggest you add the tag "regfreecom" as that tag is more common for registry free COM questions?Membrane
... actually I just retagged it myself... hope that OKMembrane
Sure. Consistent tags are more useful.Putnem
F
9

This issue is related to how SxS calculates the size of the class information. The version number of the assembly is part of this information.

Since it was working with the release candidate version number, perhaps the workaround for you is to make the version number of the release the same length as the RC release.

If this doesn't work for you, there is an established process for requesting redistribution rights for hotfixes. I would engage Microsoft customer support to pursue this route.

Flynt answered 19/4, 2009 at 10:45 Comment(0)
B
4

We're using registration-free COM for both native and .NET components. We decided to use a fixed assembly version number for these components (mainly to prevent cluttering the registry when repeatedly regasm-ing .NET components that had a dynamic build number/*). Not ideal but we have other ways of determining which version of a given component is being used (they're never patched individually).

That sounds like a very nasty issue indeed! That KB article almost makes it seem like using SxS is optional... As far as I know it's the only way to do reg-free COM?

Benita answered 8/3, 2009 at 5:32 Comment(1)
Thanks for replying. Hearing about others using reg-free COM for .NET without issues at least indicates that we may simply have been unlucky. Note that what triggered the issue for us was probably a change in size of the assembly. Not changing the version will probably not protect you.Putnem
R
1

FYI the hotfix is now directly downloadable: http://www.microsoft.com/en-us/download/details.aspx?id=27680

Refresh answered 20/7, 2012 at 6:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.