Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

.Net Plaform Standard implementation on .Net 4.7 has version inconsistency for System.Net.Http #558

Closed
santhoshkumarmksss opened this issue Oct 27, 2017 · 4 comments

Comments

@santhoshkumarmksss
Copy link

I have been using WCF service with .Net 4.7 version and it has project reference of Standard library with version 1.6. If I am using reflection getting bellow error

System.IO.FileLoadException: 'Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'

Code which generates error:
Type type = (from assembly in AppDomain.CurrentDomain.GetAssemblies()
where assembly.GetName().Name == "TestStandard"
select assembly.GetType("MoE.ERS.DTO.ResourceRequests.PlaygroupResourceRequestDTO")).FirstOrDefault();

I have attached sample project reference for which i am getting below error. Also i tried binding redirect in Web.config and still no luck.

Any quick help will be much appreciated.
WcfService1.zip

@santhoshkumarmksss santhoshkumarmksss changed the title .Net Plaform Standard implementation on .Net 4.7 has version inconsistency for System.Net.Http Be as descriptive as you can with your title. .Net Plaform Standard implementation on .Net 4.7 has version inconsistency for System.Net.Http Oct 27, 2017
@joperezr
Copy link
Member

mm I'm not sure why do you think this is a problem related to System.Net.Http. I believe that the problem has more to do with the fact that you are trying to use reflection to load a library that was compiled against .net standard 1.6. @weshaggard can probably provide more info here, but I believe that everytime that you try to use reflection to load an assembly, you should do it using the runtime for which the assembly was targeting.

@rajurh
Copy link

rajurh commented Dec 5, 2017

Any help on the above issue will be much appreciated.

@GSPP
Copy link

GSPP commented Oct 14, 2018

I'm tracking related issues and information in a list. They are related to System.Net.Http, System.Runtime, System.IO, System.ValueTuple, System.Buffers and others.

https://github.com/dotnet/corefx/issues/32587
https://github.com/dotnet/corefx/issues/32561
#481
#567
#558
#887
#891
https://github.com/dotnet/corefx/issues/32610
https://github.com/dotnet/corefx/issues/30642
https://github.com/dotnet/corefx/issues/32757
#895
#877
#521
#295
#476
#184

.NET 4.7.2 helps with some but not all of these. You can look at my comments on some of these issues for some ideas on how to work around those problems. I also have a central list of ideas to try.

@wtgodbe
Copy link
Member

wtgodbe commented May 30, 2019

Closing as dupes of the issues listed in the above comment

@wtgodbe wtgodbe closed this as completed May 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants