OpenSilver with Service References

376 views Asked by At

Im trying to migrate a Silverlight application to OpenSilver. The application uses WCF service references that are included in the project.

I followed the OpenSilver example on migrating from Silverlight to OpenSilver https://doc.opensilver.net/documentation/migrate-from-silverlight/example.html

After wrapping the application with the OpenSilver files I get an error that my services namespace could not be found, then when trying to add that missing service reference to the project I get "The target framework 'netcoreapp2.0' is out of support"

Is there a step I am missing in setting this up?

1

There are 1 answers

0
kingabo On

If you get the error because you copy-pasted the server references as well

If you double click that error it should bring you to the Reference.svcmap file of your WCF service reference. Find the Reference.cs file in Solution Explorer next to Reference.svcmap.

Open it and you will see the same error multiple times in the code:

"The type name 'IHttpCookieContainerManager' could not be found in the namespace 'System.ServiceModel.Channels'. This type has been forwarded to assembly 'System.ServiceModel.Http, Version=4.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Consider adding a reference to that assembly."

Solution: add the following nuget package: System.ServiceModel.Http

If you try to add a new service reference then follow this workaround: https://github.com/dotnet/wcf/issues/4766#issuecomment-1007859628

I hope that helps.