Shared ECLR Library in Visual Studio

Hello there,
I have one eCLR Main Project („Project A“) (eCLR 3.3 Profile) which references another project of the same type (eCLR 3.3 Profile) („Project B“).
I need Project B as a Class Library for reusability purposes (reusable structs/functions).
My problem is that when I move a typical struct from „Project A“ to „Project B“ and I compile the solution then I get this error message:
Program.cs(25,10,25,20): error CSADD007: The type ‚testStruct‘ of the field(s) ‚testStruct‘ has to be compatible to an IEC 61131-3 type. All possible types are listed in the Readme.txt of the VS Template. (CSADD007) (https://github.com/PLCnext/PLCnext_CLI_CSharp_CodeAnalyzer/blob/main/Rules/CSADD007.md)Program.cs(25,10,25,20): error CSADD013: The field type ‚testStruct‘ of the field(s) ‚testStruct‘ has an incorrect IEC 61131-3 type in the DataType attribute. The type is compatible to the IEC 61131-3 types: No compatible type found!. (CSADD013) (https://github.com/PLCnext/PLCnext_CLI_CSharp_CodeAnalyzer/blob/main/Rules/CSADD013.md)
The exact same struct was working correctly when it was placed inside Project A.
I have also referenced Project B correctly into Project A.

Any thoughts on this?

Hello dimitrismvrm,
I’m not sure if your question can be answered by someone without the source code/VS_project in time. If you need a quick help, please contact the Phoenix Contact department in your country and provide the needed information/data to resolve this request.
BR Eduard

My question can be pretty much simplified though. Is it possible to have an eCLR Project with some structs in Visual Studio which I can share in another eCLR Project without copying and pasting the same files (structs)?

I am told that this should be possible.
Can you please provide a simple, step-by-step example showing the process of defining a struct in one VS project, and then using that struct in a second VS project? If we can reproduce the issue you’re seeing, then it will help to diagnose the problem.