CsWinRT icon indicating copy to clipboard operation
CsWinRT copied to clipboard

Remove generated 'As<I>()' methods for static types

Open Sergio0694 opened this issue 1 year ago • 1 comments

This PR removes the generated As<I>() methods on static RCW types. This method is:

  • Unnecessary, now that ActivationFactory is public
  • Only works with either [ComImport] types, or via IDIC
  • It doesn't exist on non-static RCW types, which is not consistent (eg. Win2D uses that)

Devs should just use ActivationFactory directly, which also exposes new high perf methods.

Sergio0694 avatar May 10 '24 09:05 Sergio0694

Isn't it an ABI breaking change? I don't think it's acceptable though as all existing apps including WinRT component libraries will stop working. Maybe you can put this under yet another feature flag to make it an opt-in feature. Keeping the As<I>() is also good for developer experience (string cannot be replaced automatically when doing refactor on namespace/type names).

hez2010 avatar May 10 '24 13:05 hez2010

Closing this too, moving to 3.0.

Sergio0694 avatar Mar 08 '25 04:03 Sergio0694