Wcf: Self Contained .net Core Console with WCF proxy : File or Assembly System.Private.ServiceModel 4.1.2.4 Not Found

Created on 17 Apr 2019  路  6Comments  路  Source: dotnet/wcf

Hello, I made a project Console .net Core 2.2 with a WCF Client.
All works well, but when I tried to publish self contained, an expection is thrown when running

image

It seems to look for the wrong version of System.Private.ServiceModel : Version 4.1.2.4
but the project depends on the version 4.4.4

image

Moreoever the assembly seems to be missing in the publish folder...

Can you please tell me what steps can I follow to troubleshoot this problem?

Thanks :)

Backlog bug

Most helpful comment

@nicoclau Yes, I can repro it. Thank you for the standalone repro program! We still need to investigate why it happens. In the meantime, please to update to WCF 4.5.3 package.

All 6 comments

Well I made it work, it is weird though...
I just upgraded the nuget to a more recent version






image

So System.Private.ServiceModle is also at the version 4.5.3, and the self-contained app works properly with WCF now.

Do you know why?
It is annoying to stumble over a problem like that.
The version 4.4.4 was used by Visual Studio 2017 v 15.7.2 with the last version of .net core 2.2

image

image

I used this version 2.2.106 which is compatible for Visual Studio 2017
As 2.2.203 is compatible only for Visual Studio 2019 it seems.

That is also not clean in my humble opinion..

Can you tell us why the version 4.4.4 didnt work in self contained version?
Also A weird thing I noticed, the assembly System.Private.ServiceModel was not included in the app.

Thank you guys :)

@nicoclau can you share a project file repro the issue that you originally reported?

No problem Alicia, I made another project which just used a simple web service the famous calculator.

I tested the "Add" for adding 2 numbers.
You will see it works well in Visual Studio, but it will not work well in self contained version.

You must publish the self contained app yourself as it is too big to send here :(

I didnt update the nugets, I left them unchanged, exactly as Visual Studio added when I used the service reference wizard.

You will see the error when running the exe of the published self contained app "Test.exe"

image

Here the project
Test.zip

Please make me know what happens :)
Thanks

Kind regards
Nicolas

Could you reproduce the problem Alicia?

Thanks :)

@nicoclau Yes, I can repro it. Thank you for the standalone repro program! We still need to investigate why it happens. In the meantime, please to update to WCF 4.5.3 package.

Perfect :) Glad you could see the problem.
Anyway it is better to update, but still it interests me to know why the bug came up :+1:

Was this page helpful?
0 / 5 - 0 ratings