[GeneratedComInterface] Produces SYSLIB1051 in WinUI3 project even though I have DisableRuntimeMarshalling=true
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 1.3k
- PR merge metrics
- PR metrics pending
Description
### Description
In a WinUI3 project I get errors telling me that I need to set DisableRuntimeMarshalling but I have done so. And if I add `[assembly:DisableRuntimeMarshalling]` then I get a "duplicate attribute defined" later during compile.
### Reproduction Steps
I pushed a repro up here: https://github.com/jevansaks/WinUI3ComGeneratorsRepro
But the repro is:
1. File => New Project "WinUI Blank App (Packaged)"
2. Add this to the csproj:
```xml
true
true
true
```
3. Add this to app.xaml.cs:
```c#
[Guid("00000000-0000-0000-0000-000000000003"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), GeneratedComInterface]
public partial interface IRepro
{
void Test(global::System.Drawing.Point pt);
}
```
### Expected behavior
Compiles.
### Actual behavior
Gives a confusing error:
>App.xaml.cs(33,48,33,50): error SYSLIB1051: Runtime marshalling must be disabled in this project by applying the 'System.Runtime.CompilerServices.DisableRuntimeMarshallingAttribute' to the assembly to enable marshalling this type. The generated source will not handle marshalling of parameter 'pt'. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1051)
### Regression?
_No response_
### Known Workarounds
_No response_
### Configuration
_No response_
### Other information
This seems to be because XamlPreCompile doesn't get all the things passed to it that CoreCompile does. Again. Why does this target exist? :)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.