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

LoadAll method throwing exception System.FormatException: 'Value 'established,related,untracked' for property 'ConnectionState(connection-state)' is not in expected format #94

Open
kuski-jabir opened this issue Jan 9, 2024 · 0 comments

Comments

@kuski-jabir
Copy link

I was following the documentation in order to apply firewall filter to a mikrotik router.
`

        try
        {

            using (var tikConnection = ConnectionFactory.OpenConnection(TikConnectionType.Api, routerApiAddress, username", password))
            {
                var firewallFilter = new FirewallFilter()
                {
                    Chain = FirewallFilter.ChainType.Forward,
                    Action = FirewallFilter.ActionType.Drop

                    //ConnectionBytes = 0
                };
                tikConnection.Save(firewallFilter);

                 var loaded = tikConnection.LoadAll<FirewallFilter>().First();


        }
        catch (Exception ex)
        {
            result.TechnicalMessage = ex.Message;
            result.IsOkay = false;
            return result;
        }

        
    `

however the following exception is thrown when i try to retrieve the applied rules.
System.FormatException: 'Value 'established,related,untracked' for property 'ConnectionState(connection-state)' is not in expected format 'tik4net.Objects.Ip.Firewall.FirewallFilter+ConnectionStateType'.'

Adding the ConnectionState Property didn't change the error
` var firewallFilter = new FirewallFilter()
{
Chain = FirewallFilter.ChainType.Forward,
Action = FirewallFilter.ActionType.Drop,
ConnectionState = FirewallFilter.ConnectionStateType.New

                    //ConnectionBytes = 0
                };`

The same behavior was replicated when using DeleteAll and LoadList methods.
tik4Net version 3.50

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