.NET Core 2.0 console app: Could not load file or assembly System.ServiceModel version 3.0.0.0 - wcf

Possibly related to ASP.NET Core 2.0 Could not load file or assembly System.ServiceModel
We are currently developing a console app using .NET Core 2.0 as framework that references a .NET Framework 3.5 WCF library.
When we execute the console app an error appears in the debug output:
Could not load file or assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.
What do we have to do to get this assembly visible to the Dotnet Core 2.0 console app?

Related

Running in assembly related Issues while publishing/compiling a blazor client application in release mode

I am getting below errors while trying to build/publish a blazer application (client version) in release mode. The application is running fine and is getting published as well in debug mode.
Unhandled exception. Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'ExistingLibraryBuiltIn.NetFramework4.7.1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' C:\...\.nuget\packages\microsoft.aspnetcore.components.webassembly.build\3.2.0-rc1.20223.4\targets\Blazor.MonoRuntime.targets 284
ILLink failed with exit code -532462766.
Project Details -
VS Version - 16.7.0 Preview 2.0,
Target Framework - .Net Standard 2.1

.Net Core 2.1 Console Application Referencing .Net Framework 4.6.1 DLL - Possible?

Is it even possible for a .Net Core 2.1 console application to reference a .Net Framework 4.6.1 DLL?
I have such a DLL that consumes a WCF service successfully. I now wish to use this DLL from a .Net Core 2.1 console application. But I am getting an exception stating that it cannot load assembly System.ServiceModel. The web.config file in the 4.6.1 DLL has relevant settings for System.ServiceModel.
Many thanks.

asp.net core web api + could not load assembly exception

I am creating a fresh ASP.net core web API.
I have referenced a project DLL in my web API which is again referring to system.web.application.services.dll.
The solution is building fine but getting the below exception when I call POST verb from POSTMAN.
Error details:
Could not load file or assembly 'System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified
It sounds like you're referencing a .NET Framework 4.6 (or below) DLL in your .NET Core project. You have two options:
Add a reference to System.Web.ApplicationServices in your project. You may have to browse for the actual DLL (System.Web.ApplicationServices.dll), which you should be able to find in C:\Windows\Microsoft.NET\Framework64\v4.0.30319.
(I think this will work) Change your project to target the full .NET Framework instead of .NET Core.
You might run into other roadblocks after doing this, but it's a step in the right direction.

AspNet Core 1.1. referencing .net 4.6 project fails on runtime

I have an ASP.NET Core 1.1. web application and I have successfully referenced it to a .NET 4.6 class library.
When a call is made from one of the web application's controllers to one of the public methods of .NET 4.6 class library I am getting the following exception:
"Could not load file or assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified."
Any ideas, how I can correct that?

How do I add a .NET Core Class Library dll to ASP.Net core project

when I add a .NET core class library dll to my ASP.NET core project and try to use it in my code, I get the following:
FileNotFoundException: Could not load file or assembly
'Test.Core, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null'. The system cannot find the file specified.
I'm on .NET Core 1.1 for both projects. The dll is referenced in the project. I assume I need to add the reference of this class dll in some config file but I searched everywhere and couldn't find where.
Any help would be appreciated
Patrick
Until they fix the issue in 1.1, if possible, if you jump back to 1.0 this should not be a problem as i can get it working fine on 1.0.