저는 AspNet Web Api Client 5.0을 사용하고 있으며 웹 API 컨트롤러를 테스트하고 있습니다. , 버전 = 4.5.0.0 파일이나 어셈블리를로드 할 수 없습니다 'Newtonsoft.Json :오류 단위 테스트 webapi 컨트롤러
var encservice = new EncryptionService();
var acctservice = FakeServices.GetAccountService();
var controller = new AccountController(acctservice, encservice);
controller.Request = new HttpRequestMessage();
코드
controller.Request.SetConfiguration(new HttpConfiguration());
이 실행될 때 나는 예외
메시지 충돌 문화 = 중립, PublicKeyToken = 30ad4fe6b2a6aeed '또는 그 종속성 중 하나. 찾은 어셈블리의 매니페스트 정의가 어셈블리 참조와 일치하지 않습니다. (HRESULT에서 예외 : 0x80131040)
자료 : System.Net.Http.Formatting
스택 트레이스 : System.Net.Http.Formatting.JsonMediaTypeFormatter..ctor()에서의 System.Net .Http.Formatting.MediaTypeFormatterCollection.CreateDefaultFormatters()에서 System.Net.Http.Formatting.MediaTypeFormatterCollection..ctor ()에서 System.Web.Http.HttpConfiguration.DefaultFormatters ()에서 System.Web.Http.HttpConfiguration .. ctor (HttpRouteCollection routes) at System.Web.Http.HttpConfiguration..ctor() C에서 EMR.Test.Controller.AccountControllerTest.Should_Get()에서 : \ PremiumProjectsCollection \ EMR \ SRC \ EMRAzure \ EMRAzure \ EMR.Test \ 컨트롤러 \ AccountControllerTest.cs : NEWSOFT 라인 34
버전. 내가 사용하고 JSON은 6.0
가나는 또한 내 confguration 파일
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
에서 사용하는 메신저 테스트 러너를 조립 리디렉션이입니다 MSTEST, VS2012
나는 동일한 문제에 직면하고있다. 너는 그것을 해결 했니? –
@ Jean-FrançoisBeauchamp, Newtonsoft.Json 4.5.0.0에 롤백했습니다. – reggieboyYEAH
동일한 문제가 있습니다. 이 문제가 해결 되셨습니까? –