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

System.ServiceModel.Primitives in NetStandard 2.0 library requires System.Private.ServiceModel which is not available through Nuget UI #777

Open
dgxhubbard opened this issue Jun 7, 2018 · 6 comments
Assignees

Comments

@dgxhubbard
Copy link

We are running on Visual Studio 15.7 and we have a .net standard library 2 that has the ServiceContract attribute on several interfaces.
The .net standard library 2 is used in .net core 2.1 and .net 4.7.1 apps and referenced in other libraries. In the .net 4.7.1 app it provides the interface to WCF services. In .net core 2.1 it is just an interface. We recently loaded System.ServiceModel.Primitives 4.5.0 release version and started getting the message that Sytem.Private.ServiceModel.dll could not be found. So I opened the NuGet UI and searched for it and could not find it, and then went to nuget.com and saw it and used the package manager console to load it, and manually added reference in the project. This works, but is it possible to make Sytem.Private.ServiceModel. available from the NuGet UI.

@StephenBonikowsky
Copy link
Member

I'm looking into this.

@StephenBonikowsky
Copy link
Member

StephenBonikowsky commented Jun 11, 2018

@dgxhubbard

System.Private.ServiceModel contains the implementation of all 5 WCF core public packages and is not meant for direct consumption and shouldn't be referenced directly. It should be automatically pulled-in when using one of the public WCF packages which is why it is not found via the VS NuGet UI.

I setup your scenario (VS version 15.7.3) and I was unable to get VS to reproduce your error without manually intervening.
S.ServiceModel.Primitives in your .NET Standard library uses S.Private.ServiceModel at run-time, whereas in your .NET Fx project targeting 4.7.1, S.ServiceModel.Primitives type-forwards to .NET Fx 4.7.1.

If I manually replace the S.ServiceModel.Primitives used at run-time by the .NET Fx app with the one from the .NET Standard library it will try to use S.P.SM but not find it which would be expected.

Could not load file or assembly 'System.Private.ServiceModel, Version=4.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Perhaps you have some custom task that is copying assemblies around?

@Luke8519
Copy link

Luke8519 commented Jul 9, 2018

Hi

I am also having a very similar issue as @dgxhubbard or atleast the similar symptoms,

I am currently in the process of creating a xmararin forms project and consuming a WCF service. In andriod and IOS projects the WCF calls work fine. However when trying to contact the service in UWP/UI Test I get the exact same error above.

Could not load file or assembly 'ServiceModel.Primitives Version=4.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

I have tried some of the suggestions on other posts such as downgrading the primitives version on the effected UWP/UI projects and targeting framework version 4.6.1 but I get the same issue.

The WCF service I am consuming uses serviceModel 4.0.30319 on .net461 but the xmararin solution I have made is using .netStandard2.0 which I think is where the issue lies.

The version of VS I am using is 15.7.2.

If you need more info please let me know.

Thanks for your help :)

@StephenBonikowsky
Copy link
Member

Thanks @Luke8519 This week I've been busy with some other work, adding @mconnew in case he can take a look before I do.

@lukedevwinthorpe
Copy link

Thanks @StephenBonikowsky its a bit of a headscratcher. Ill keep digging in the mean time.

@Luke8519
Copy link

Hi all, Ive done a bit more digging and found that the issue only occurs when the solution is running in in debug mode, run the UWP in release mode it works fine. I am not sure what the difference is between the debug and release versions.

Is there a way I can specifically target a specific version of the service model primitives when my application is running via UWP.

Thanks in advance
Luke

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

No branches or pull requests

4 participants