OPCFoundation / UA-.NETStandard-Samples

Other
263 stars 187 forks source link

Hard to get the samples to work. #615

Open jvanlangen opened 5 months ago

jvanlangen commented 5 months ago

Type of issue

Current Behavior

Cloning the repo, launch VS and load an example. Compiler errors....

Expected Behavior

Cloning the repo, launch VS and load an example. No compiler errors.

Steps To Reproduce

Clone the repo, open (for example) the UA Sample Server

Environment

- OS: Windows 11
- Environment: Warm
- Runtime: ones
- Nuget Version: 1.5.374.54
- Component: Server
- Server: yes
- Client: no

Anything else?

Does it look, that this sample is dependend on other samples? Still trying to get it compiled..

jvanlangen commented 5 months ago

A, found solutions outside the sample directory 🤡

jvanlangen commented 5 months ago

Too bad:

Metadata file 'C:\Users.....nuget\packages\microsoft.extensions.logging.abstractions\3.1.32\analyzers\dotnet\roslyn4.0\cs\Microsoft.Extensions.Logging.Generators.dll' could not be found.

Why is this needed?

bbmmcodegirl commented 5 months ago

What's your vs version? Best use the newest one (VS2022 17.x.x, but the solution I checked out was made with 16.0.32901.82).
Open UA SampleApplications.sln .

VS can restore the packages if you use nuget.org as the package source.

Make the server the startup project and just build, it should work.

NenadSteric commented 4 months ago

With Rider JetBrains Rider 2024.1.4 I cannot compile the UA Sample Applications solution at all. nuget restore is apparently not able to find the nugets

With VS 2022 i get this errors for the UA Sample Applications solution

Severity Code Description Project File Line Suppression State Error Two output file names resolved to the same output path: "obj\Debug\Opc.Ua.Client.Controls.BrowseTreeCtrl.resources" UA Client Controls
Error Two output file names resolved to the same output path: "obj\Debug\Opc.Ua.Server.Controls.ExceptionDlg.resources" UA Server Controls
Error Two output file names resolved to the same output path: "obj\Debug\Quickstarts.ReferenceClient.MainForm.resources" Reference Client
Error Two output file names resolved to the same output path: "obj\\Quickstarts.ReferenceServer.MonitoredItemEventLogDlg.resources" Reference Server
Error The target "GetTargetPath" does not exist in the project. UA Sample Client C:\develop\UA-.NETStandard-Samples\Samples\Opc.Ua.Sample\Opc.Ua.Sample.csproj
Error The target "GetTargetPath" does not exist in the project. UA Sample Client C:\develop\UA-.NETStandard-Samples\Samples\Opc.Ua.Sample\Opc.Ua.Sample.csproj

For UA Quickstart Applications I get this error for every project :

Severity Code Description Project File Line Suppression State Warning Found conflicts between different versions of "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets" that could not be resolved. There was a conflict between "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets, Version=2.1.40.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" and "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets, Version=2.2.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60". "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets, Version=2.1.40.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" was chosen because it was primary and "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets, Version=2.2.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" was not. References which depend on "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets, Version=2.1.40.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" [C:\Users\nest.nuget\packages\microsoft.aspnetcore.server.kestrel.transport.sockets\2.1.40\lib\netstandard2.0\Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll]. C:\Users\nest.nuget\packages\microsoft.aspnetcore.server.kestrel.transport.sockets\2.1.40\lib\netstandard2.0\Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll Project file item includes which caused reference "C:\Users\nest.nuget\packages\microsoft.aspnetcore.server.kestrel.transport.sockets\2.1.40\lib\netstandard2.0\Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll". C:\Users\nest.nuget\packages\microsoft.aspnetcore.server.kestrel.transport.sockets\2.1.40\lib\netstandard2.0\Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll References which depend on or have been unified to "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets, Version=2.2.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" []. C:\Users\nest.nuget\packages\microsoft.aspnetcore.server.kestrel\2.1.3\lib\netstandard2.0\Microsoft.AspNetCore.Server.Kestrel.dll Project file item includes which caused reference "C:\Users\nest.nuget\packages\microsoft.aspnetcore.server.kestrel\2.1.3\lib\netstandard2.0\Microsoft.AspNetCore.Server.Kestrel.dll". C:\Users\nest.nuget\packages\microsoft.aspnetcore.server.kestrel\2.1.3\lib\netstandard2.0\Microsoft.AspNetCore.Server.Kestrel.dll C:\Users\nest.nuget\packages\opcfoundation.netstandard.opc.ua.bindings.https\1.5.374.78\lib\net48\Opc.Ua.Bindings.Https.dll Boiler Server

can be fixed by removing this from App.config

This warning leads to an runtime error, and the server(s) cannot start. Why is this included ?

romanett commented 4 months ago

@NenadSteric Can you please try to clone the repository into a clean new folder. I can`t reproduce any of the errors unfortunately

mregen commented 2 months ago

@NenadSteric and @jvanlangen, we bumped to the latest Nuget packages and tested the build of all apps. There were some issues but should be resolved now. Please use the latest VS 2022. Are you maybe using community version or additional add ons (JetBrains)? (Those are not regularly tested) The build relies on a preview package feed from the opc foundation, defined in Nuget.Config? Could you chekc it works for you?