CsWinRT icon indicating copy to clipboard operation
CsWinRT copied to clipboard

C# language projection for the Windows Runtime

Results 226 CsWinRT issues
Sort by recently updated
recently updated
newest added

This PR adds some size saving and experimentation options to the authoring sample using NativeAOT. Most importantly, it also sets the options to generate the necessary files to use [sizoscope](https://github.com/MichalStrehovsky/sizoscope),...

authoring
trimming
AOT

**Describe the bug** Setting up simple UWP or console apps from the given VS templates cannot use CsWinRT. When trying to compile said apps, this error occurs: Microsoft.AppXPackage.Targets(1437,5): error MSB3816:...

bug

**Describe the bug** FrameworkElementAutomationPeer has only a 1-param constructor, but the generated code doesn't call it. **To Reproduce** ```c# public sealed class TestAutomationPeer : FrameworkElementAutomationPeer { public TestAutomationPeer(FrameworkElement owner) :...

bug

**Describe the bug** The logic used in `ManagedIPropertyValueImpl` to unbox arbitrary types is completely not safe and relies on undefined behavior: https://github.com/microsoft/CsWinRT/blob/eb066e4a179767e5598fd901652a625941f0b9db/src/WinRT.Runtime/Projections/IPropertyValue.net5.cs#L199-L218 It is not legal to **ever** use `Unsafe.As(object)`...

bug

I'm using `MediaTranscoder` WinRT API to convert audio files. It accepts two `IRandomAccessStream`'s, for source and destination data. It works OK when these streams are native WinRT streams, but if...

bug
gc

**Describe the bug** Just noticed the following failure when using `WindowId` as a parameter for a method: > "CSC : warning CS8785: Generator 'SourceGenerator' failed to generate source. It will...

bug
authoring

Contracts seem to be unconditionally generated as public. Generated code shows up as this even if `true` ``` [global::Windows.Foundation.Metadata.ContractVersion(1u)] public enum FooContract { } ```

bug

Today, calls to `GuidGenerator.GetIID` are optimized into constant or partially pre-calculated values after compilation with IL editing. The C# compiler has an experimental feature to intercept calls by callsite and...

bug

**Describe the bug** `Microsoft.UI.Xaml.GridLength` is very different on Win32 vs UWP. For instance Microsoft.UI.Xaml.GridLength has different constructors between UWP and .NET Core, and the .NET Core one is immutable. So...

bug

## Summary See https://learn.microsoft.com/en-us/dotnet/standard/native-interop/disabled-marshalling. CsWinRT's runtime assembly and all projection assemblies should use `[assembly: DisableRuntimeMarshalling]`. This would also ensure that no accidental marshalling could be triggered, as seen in the...

enhancement