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

Opc.Ua.Di.Classes.cs does not compile #19

Closed
nooelan opened this issue Feb 6, 2019 · 1 comment
Closed

Opc.Ua.Di.Classes.cs does not compile #19

nooelan opened this issue Feb 6, 2019 · 1 comment

Comments

@nooelan
Copy link

nooelan commented Feb 6, 2019

The commit 6f8c38d (Update DI to 1.02 Release Candidate) causes the generated Opc.Ua.Di.Classes.cs file to fail during build with the following errors:

Severity Code Description File Line
Error CS0100 The parameter name 'context' is a duplicate Opc.Ua.Di.Classes.cs 5915
Error CS0841 Cannot use local variable 'context' before it is declared Opc.Ua.Di.Classes.cs 5878
Error CS0136 A local or parameter named 'context' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter Opc.Ua.Di.Classes.cs 5883
Error CS1503 Argument 1: cannot convert from 'string' to 'Opc.Ua.ISystemContext' Opc.Ua.Di.Classes.cs 5890

The reason for these build errors are fairly obvious, but in short:

The Call funtion in line 5870 has a parameter ISystemContext context.
In line 5883 a variable is declared with the same name:

protected override ServiceResult Call(
   ISystemContext context,
   NodeId objectId,
   IList<object> inputArguments,
   IList<object> outputArguments)
{
   ...
   string context = (string)inputArguments[0];
   ...
}

Furthermore, the InitLockMethodStateMethodCallHandler function in line 5911 has two parameters named context:

    public delegate ServiceResult InitLockMethodStateMethodCallHandler(
        ISystemContext context,
        MethodState method,
        NodeId objectId,
        string context,
        ref int initLockStatus);
@opcfoundation-org
Copy link
Contributor

Added mantis issue: https://apps.opcfoundation.org/mantis/view.php?id=4714

Latest code on master branch should fix.

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

2 participants