Skip to content

The generated Marshaller has mistaken namespace #1632

@wherewhere

Description

@wherewhere

Actual behavior

When CsWin32RunAsBuildTask is true, the generated Marshaller has mistaken namespace:

[DebuggerDisplay("{Value}"),NativeMarshalling(typeof(global::Java..InteropServices.JBooleanMarshaller))]
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.269+368685089b.RR")]
internal readonly partial struct JBoolean : IEquatable<JBoolean>;

Image

namespace .InteropServices
{
    [global::System.Runtime.InteropServices.Marshalling.CustomMarshaller(typeof(Java.JBoolean),global::System.Runtime.InteropServices.Marshalling.MarshalMode.Default,typeof(JBooleanMarshaller))]
    internal static class JBooleanMarshaller;
}

Image

Expected behavior

The .InteropServices should be InteropServices.

Repro steps

I don't know what happened here. Maybe it is because the root namespace only has one depth. Something like ${sub}.InteropServices become the .InteropServices.

Context

  • CsWin32 version: 0.3.269
  • Target Framework: net10.0-windows
  • LangVersion (if explicitly set by project): latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions