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

[QUESTION] Including own Library (which depends on TcOpen) in Project with TcOpen, how to make it work with Compiler #717

Open
RGrabichler opened this issue May 29, 2024 · 6 comments
Assignees
Labels
question Further information is requested

Comments

@RGrabichler
Copy link
Collaborator

I have a Standard Library, which depends on TcOpen internally.
I have a normal Project, where include TcOpen (compiler with net5.0 Library Project and 5.0 Blazor)

As soon as i include my own Library, the "reading identities" will not continue anymore.

How to solve this, perhaps a minimalistic Example, how to solve this.

@RGrabichler RGrabichler added the question Further information is requested label May 29, 2024
@RGrabichler
Copy link
Collaborator Author

Now this is working, but i do not know why.
Next Problem is, Inxton Compiler does not recognice my Structures, Fbs etc., so i cannot use them in HMI.
image
image
image
I have them instantiated with fully qualified name
image

i tried to add the Connector Project of the library to the Project, and add a Project Reference from the Project Connector to the Library Connector, but i cannot get it to work.

What can i do

@PTKu
Copy link
Member

PTKu commented May 30, 2024

Hey @RGrabichler

you may need to add the following to the csproj file of your connector project

<Content Include="_meta\{YourLibraryName}.library" IncludeInPackage="true" Pack="true" PackagePath="lib" CopyToOutputDirectory="PreserveNewest" />
    <Content Include="_meta\YourLibraryName.json" IncludeInPackage="true" Pack="true" PackagePath="lib" CopyToOutputDirectory="PreserveNewest" />          
    <Content Include="_meta\version.info" IncludeInPackage="true" Pack="true" PackagePath="lib" CopyToOutputDirectory="PreserveNewest" />   

let me know if that helps

@RGrabichler
Copy link
Collaborator Author

is this for NuGet Packages?
can u provide a more detailed example.

Workflow should be (in 4026 changes)

I work on a plc library, then include it in plc project.
In Plc Project i additionally have a Connector and a Blazor App.
The Inxton Compiler does not recognice the FBs and Types from the Library.

If i add the above to ny csproj file, do i also have to the the "library Connector" to the Plc Project,
and add the Include Lines there? or just in the Plc Project Connector (where does it get the Info from)

@PTKu
Copy link
Member

PTKu commented May 30, 2024

It will include the metadata in the output (bin) folder of your library (besides packing it into NuGet when packing). The important part is the {YourLibraryName}.json file, which is where the compiler gets the information about the types that exist in the library. You should also check that your connector project contains {YourLibraryName}.json in the _meta folder.

You will also need to add your library project (connector and plc project) to your solution. If you do not want to do that, then you should release NuGet package and consume that.

@RGrabichler
Copy link
Collaborator Author

Thanks @PTKu, with the Inclusion of the Library-Connector in my Project and your proposed changes to the .csproj it is working.

One Problem, we talked about this earlier, where the "reading identities" not working anymore.
It occurs sometimes, i do not know why.
I have a Library Categories, when i make changes there, it stops working.
Then i do not have another possibility to make it run again, as to copy a working Project, rename everything and copy my Library Content into it.
Something very spooky is happening there

@PTKu
Copy link
Member

PTKu commented May 31, 2024

There seems to be a problem with the ADS library v5 (which is currently unlisted on nuget.org).
We observed this problem with another user but were never able to replicate it ourselves. The other user could use the .NET Framework 4.8 version for his application tough.

The issue might be solved when inxton libraries are ported to newer.NET versions. Unfortunatelly, the update brings some breaking changes that need to be solved. There are no immediate plans to update at this point, but we may do the update this fall together with upgrading to 4046. If we decide to port to higher .NET versions, they will remain experimental (as the v5 is).

The only supported version remains .NET Framework 4.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants