Skip to content

Auto adding references/dependencies? #61

@nomi-san

Description

@nomi-san

I'm trying to build a winforms code using .NET 7 shared DLLs.

using System;
using System.Windows.Forms;

Application.Run(new Form());

Build command:

$ cd dotnet-sdk-7.0.101-win-x64\shared\Microsoft.WindowsDesktop.App\7.0.1
$ bflat build main.cs -r System.Windows.Forms.dll --ldflags "/subsystem:windows"

Output:

...Failed to load assembly 'System.Windows.Forms.Primitives'

# added -r System.Windows.Forms.Primitives.dll
...Failed to load assembly 'System.Drawing.Common'

# added -r System.Drawing.Common.dll
...Failed to load assembly 'Accessibility'
...Failed to load assembly 'Microsoft.Win32.SystemEvents'

Finally, it's done after I added all missing dependencies by hand 😪

-r System.Windows.Forms.dll
-r System.Windows.Forms.Primitives.dll
-r System.Drawing.Common.dll
-r Accessibility.dll
-r Microsoft.Win32.SystemEvents.dll

I hope it should support as the title says,

or at least the -r option allows *.dll 😀


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions