-
Notifications
You must be signed in to change notification settings - Fork 560
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
Could not load file or assembly 'System.Private.ServiceModel, Version=4.1.2.2 #2824
Comments
@ssashok10 thanks for reporting the issue. I can reproduce it. Here is just a quick workaround to unblock you. We will need to take a further look of the issue. First, copy file Then, copy/paste below to your project's .csproj file. It will include S.P.SM.dll for build and publish.
|
The work around worked well. Thanks for looking into it. |
Thanks for the confirmation @ssashok10. Reactivating the issue to track root-cause investigation. |
We are currently reproducing this on our side too. The work around we use is to copy the "runtimes" folder beside our application (obtained by doing a dotnet publish). The contents of runtimes is: $find runtimes/
runtimes/
runtimes/unix
runtimes/unix/lib
runtimes/unix/lib/netcoreapp2.0
runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.dll
runtimes/unix/lib/netstandard2.0
runtimes/unix/lib/netstandard2.0/System.Private.ServiceModel.dll
runtimes/win
runtimes/win/lib
runtimes/win/lib/netcoreapp2.0
runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.dll
runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll
runtimes/win/lib/netstandard2.0
runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll
runtimes/win/lib/netstandard2.0/System.Private.ServiceModel.dll |
I still have this issue in VS 15.8 Preview 5 when generating a wcf connected service reference in a .net standard 2-based Azure Functions project. |
Any idea when a permanent fix will be available? This is quite a hassle to deal with both debugging locally and in our devops pipeline. |
Anyone else dealing with this issue: to make life slightly better add the System.Private.ServiceModel nuget to the project then only add this section to the .csproj. No manual copy of the offending assembly is required to the root folder (may even work on your build server but YMMV). Note that the version specified in the path is the current version of the assembly, you'll need to manually sync it with the referenced nuget package.
|
I think they marked it to be fixed in .NET Core 3.0 :) |
Well, 2019 is only a stone's throw away :) Will have to keep the workaround for now. |
Do you have a workaround that works for continuous deployment to Azure, or even basic publish from Visual Studio? I can make it work locally , but nothing more than that, |
What's not working for VS publish? I tested a publish to a local folder and all the files got copied over. |
zhenlan's workaround works great for us both locally and on our build server (msbuild publish using the 15.7 build tools) as well, using the v2 runtime. |
Looks like it is Azure function issue. When building Azure function project, system.private.servicemodel.dll should be copied to "$(OutputPath)\bin" folder along with other project dependencies. Opened issue |
I'm using this snippet with an .NET Core 2.0 class library app targeting AWS Lambda being build under Ubuntu (WSL):
This issue doesn't appear to be specific to Azure Functions projects. |
I am also having this issue. The workaround seems to be working, but can someone explain to me what is the root cause? Thanks |
@ismailhozza Please look at #Azure/Azure-Functions#974 for explaination |
@colinbowern Yes, it may not be specific to Azure Functions projects, but the root cause is the same. |
Hello, This solved the issue. |
Issue is still present in ASP.NET Core 3.0 preview 3 with a publish as a Web App. |
@vertonghenb The issue was resulted by Azure/azure-functions-host#3568, did you followed the guidance stated in that resolution? If so, please report the issue under Azure/azure-functions-host#3568. |
I'm also seeing this issue. Will it be fixed? |
have still an issue when I'm using a WCF service in an asp.net core 2.2. It just occurs in IIS environment. Even in case that I start it via command line, I'm faced with the following error: |
Solved issue by increasing version of System.ServiceModel to 4.5.3 |
The only workaround that did the job for me was copying the DLL from the runtime folder, to the bin folder, after build and publish events, by adding this to my Azure Function app csproj, I noticed the DLL is copied there, but the function host doesn't know how to find it:
|
use Install-Package System.Private.ServiceModel command on the project, its work. |
For me, it wasn't enough just to copy this assembly to the output path; the publish folder was the silver bullet in my case:
Since I was (am) publishing directly to Azure Functions from Visual Studio Code, this assembly needs to be present in the publish folder as well. Anyway, this is what finally unblocked my project and allowed my function to fly free!! |
Updating to 4.6.0 solved this issue for me and I could remove the hack. |
Update to 4.6.0 and add code Please refer |
I have similar issue with MetadataLoadContext with dotnet core 3. |
I got this with a Blazor 3.1 app. Works fine locally, but, when deployed to Azure I get: System.IO.FileNotFoundException: Could not load file or assembly 'System.Private.ServiceModel To fix it, in the Publish Profile, in Visual Studio, I changed the Target runtime from win-x86 to portable |
I'm getting this now with .NET Core 3.1. Like someone said above, upgrading to 4.6 worked. |
Could not load file or assembly 'System.Private.ServiceModel, Version=4.1.1.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. hai , iam doing one kyc application , here i have connected with web services of ndml registration .my project in developmennt its working fine . when i tried to access web services after deployment iam facing mentioned above issue. Framework : .NET Core 3.1
|
Also seeing this in net5. Runs fine in Visual Studio but if I try to publish my webapp to desk and execute the exe I get this:
|
Same issue here. Did you find any solution? |
1 similar comment
Same issue here. Did you find any solution? |
I install System.Private.ServiceModel in nuget,the problem is resolved. |
I've the issue also. But nuget lib installation do not solve. The lib is not in the publish folder when published. And crashes with the known exception. |
I search the latest version in the nuget org source and install the newest version.my sdk is .NET 8. |
the lib may be in some sub directory. |
I am using Azure Function (C#) which is calling a .NET standard library to call an external WCF service and I am getting the below error. I am not sure what exactly happening inside the Function call.
FileNotFoundException: Could not load file or assembly 'System.Private.ServiceModel, Version=4.1.2.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
Here are the platform information,
Microsoft.NET.Sdk.Functions (1.0.13)
.NET Standard Library 2.0
System.ServiceModel.Primities 4.4.2
System.ServiceModel.Http 4.4.2
There is no reference to 4.1.2.2 DLL from any of my VS projects
The text was updated successfully, but these errors were encountered: