-
Notifications
You must be signed in to change notification settings - Fork 72
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
Meaning of FirewallManager.IsServiceRunning and FirewallManager.Version #55
Comments
None of these should break your code. Can you post the code used to create the rule here? Also, on what platform are you using this library? There might be some limitations with new UI frameworks. I did not have the time or courage to try Win11 yet, probably late 2022 or next year when it is more mature; so, unfortunately, I can not provide specific support for Win11 but I try to point you in the right direction if I suspect something. |
make sure you are running the app as admin btw |
Although I am pretty sure it is running with elevated right I am going to perform a test tomorrow again. |
So after comparing with your example code and playing around I found that my net6.0 publish single configuration is the culprit. I was able to reproduce the problem with WindowsFirewallHelper.NetCoreSample by changing the csproj as below. You might have to do a clean build. cpsroj content: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishSingleFile Condition="'$(Configuration)' == 'Release'">true</PublishSingleFile>
<PublishTrimmed>true</PublishTrimmed>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BasicConsoleUtilities" Version="1.0.0.6" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WindowsFirewallHelper\WindowsFirewallHelper.csproj" />
</ItemGroup>
</Project> |
so this problem is with our latest release for .net6 probably or with the prior version; can you check the v2.2.0.86 and v2.1.4.81 separately? the only difference between the two is the net6 separate builds in v2.2.0.86. v2.1.4.81 however uses netstandard for forward compatibility.
I misunderstood the initial comment then. thought it is a win11 issue. |
Could this one be related to a general trimming incompatibilities? |
Looked a little more into this, and it appears that the problem really is related to the combination of trimming and COM interop. I was able to get it to work by adding |
Bumped into an issue today where module trimming / single assembly was also to blame. worked fine once I put it back to a normal self-contained build. |
Hi,
at first a big thanks for wrapping nicer code around the windows firewall!
I tried to use WindowsFirewallHelper to add a rule at program start to my computers firewall. After a while and with your example code I found that IsServiceRunning returns false and Version returns None. I tried on two machines running Windows 11 with same results.
On both machines "Domain Networks" is disabled, private and public networks are enabled.
Do the results refer to the disabled "Domain Networks" firewall or does it mean something different?
Thanks,
Christian
The text was updated successfully, but these errors were encountered: