Skip to content

Creating dll for c# eclr 3.2 profile

Hi,n

is it possible to create a dll from a .net core that can be used in the visual studio c# plcnext evironment.

I receive the following error:

1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3268: The primary reference "xxxxxLib" could not be resolved because it has an indirect dependency on the framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0,Profile=eCLR3.2". To resolve this problem, either remove the reference "xxxxxLib" or retarget your application to a framework version which contains "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".

Kind regards,

David de Roo

Comments

  • Hello David,


    you can create Projects with the PLCnext Visual Studio Plugin.
    Then just add some classes ect you want to create. 
    Afterwards you can build it into a DLL.
    This dll can then be Included as a reference for your FunktionBlock libraries and will automatically packaged into the *pcwlx file.

    this looks like your Project Dll has a reference on a conflicting mscorlib.

     

  • Hi Oliver,

    thanks for your answer, But the problem is that for example System.Text and System.Linq is not in the eclr library. So I can not compile my project.

    Kind regards,

    david

  • Hi David,

    To compile a C# project for the embedded CLR on a PLCnext Control, the code must only use classes that are supported by the eCLR. This is no different to any other .NET runtime e.g. Mono or .NET core - if your C# code is targeting those runtimes, you can only use classes that they support.

    The documentation that is included with each PLCnext C# project in visual studio shows all the classes that are currently supported by the eCLR.

    Martin.

Sign In or Register to comment.