Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net 8 NativeAOT Error #66

Open
KFKMan opened this issue Jul 5, 2024 · 0 comments
Open

.Net 8 NativeAOT Error #66

KFKMan opened this issue Jul 5, 2024 · 0 comments

Comments

@KFKMan
Copy link

KFKMan commented Jul 5, 2024

.Net 8, NativeAOT, Windows 10 10.0.19045, WindowsFirewallHelper 2.2.0.86

Publish Code;
dotnet publish -r win-x64 -c Release

Code;

var rule = FirewallManager.Instance.CreateApplicationRule(name, FirewallAction.Block, AppPath, FirewallProtocol.Any);
rule.Direction = direction;
FirewallManager.Instance.Rules.Add(rule);

[Error] System.NotSupportedException: Specified method is not supported.
at WindowsFirewallHelper.FirewallManager.get_Instance() + 0x58

.csproj;

  <PropertyGroup>
	  <TargetFramework>net8.0</TargetFramework>
	  <ImplicitUsings>enable</ImplicitUsings>
	  <Nullable>enable</Nullable>
	  <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
	  <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
	  <IncludeSymbolsInSingleFile>true</IncludeSymbolsInSingleFile>
	  <PublishAot>true</PublishAot>
	  <StripSymbols>true</StripSymbols>
	  <RootNamespace>KavisPlus</RootNamespace>
          <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
  </PropertyGroup>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant