falahati / WindowsFirewallHelper

A class library to manage the Windows Firewall as well as adding your program to the Windows Firewall Exception list.
MIT License
276 stars 72 forks source link

Can't access FirewallWAS.Rules in v2.1.4.81 #50

Closed Peter-Simpson closed 3 years ago

Peter-Simpson commented 3 years ago

Hi,

I'm using FirewallHelper in a .NET Framework 4.8 project and have just updated from 1.6xx to 2.1.4.81. I can't use the FirewallWAS.Rules method because it tells me that I need C# 8.0 or later and Framework 4.8 is limited to 7.3. CS8370 is raised saying that recursive patterns are not available in C#7.3. See embedded image.

I had to look through the change log to get some essential migration information; a useful addition to your documentation would be a basic migration guide saying things such as "profiles are now specified in the GetProfile constructor in FirewallManager.Instance.GetProfile()" and "change all FirewallAPIV2 references to FirewallWAS etc.

Many thanks, Peter

image

falahati commented 3 years ago

You are trying to compare the type of a variable to a property. This error is irrelevant to the C# version it is just a bad error. With .Net4.7.2 and C# 7.3 the following piece of code works: image

As for the migration, you do have a point there however unfortunately I am quite busy at the moment. But I will keep that in mind. Thank you.

Peter-Simpson commented 3 years ago

Many thanks I have now successfully migrated to version 2. I cloned the repository in the end so that I could examine it in Visual Studio to see how members had been reworked and renamed, which helped a lot.

Regards, Peter