programing

파일 또는 어셈블리 'Newtonsoft'를 로드할 수 없습니다.Json' 또는 그 종속 요소 중 하나.매니페스트 정의가 어셈블리 참조와 일치하지 않습니다.

mailnote 2023. 3. 17. 21:48
반응형

파일 또는 어셈블리 'Newtonsoft'를 로드할 수 없습니다.Json' 또는 그 종속 요소 중 하나.매니페스트 정의가 어셈블리 참조와 일치하지 않습니다.

검색한 결과:

  1. Web.config는 이전 버전에 바인딩을 설정합니다.

    <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.1.0" />
    </dependentAssembly>
    
  2. .csproj 파일을 편집하여 Newtonsoft 참조가 1개만 있는지 확인합니다.

    <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
       <HintPath>..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
       <SpecificVersion>False</SpecificVersion>
       <Private>True</Private>
    </Reference>
    
  3. 내 컴퓨터에서 모든 뉴턴소프트를 검색해봐Json.dll 및 6.0.1 버전이 아닌 모든 버전을 삭제하고 임시 폴더 내용을 삭제합니다.

  4. nuget 매니저 콘솔에서 패키지 복구/재설치

빌드에는 성공하지만 사이트에 가면 오류가 발생합니다.

편집

네, 모든 nuget 패키지와 마찬가지로 재인스톨을 시도했더니 4.5버전의 newtonsoft.json.dll이 다시 추가된 것 같습니다만, 같은 에러가 발생합니다.제 프로젝트의 타깃 프리워크는 입니다.NET 4.5.1 및 현재 취득한 스택트레이스를 다음에 나타냅니다.

'/' 응용 프로그램에서 서버 오류가 발생했습니다.

또는 할 수 .Newtonsoft.Json을 사용하다 정의가 하지 않습니다(HRESULT의 : "HRESULT: "는입니다.0x80131040)

설명:현재 웹 요청을 실행하는 동안 처리되지 않은 예외가 발생했습니다.에러와 코드의 어디에서 발생한 에러의 상세한 것에 대하여는, 스택 트레이스를 확인해 주세요.

상세: 외외 exception exception :System.IO.FileLoadException: 할 수 : 파일 또는 어셈블리를 로드할 수 없습니다.Newtonsoft.Json을 사용하다 정의가 하지 않습니다(HRESULT의 : "HRESULT: "는입니다.0x80131040)

소스 오류:

현재 웹 요청을 실행하는 동안 처리되지 않은 예외가 생성되었습니다.예외 발생원 및 위치에 대한 정보는 다음 예외 스택 추적을 사용하여 식별할 수 있습니다.

'CHANGE: 'CHANGE: 'CHANGE:는 조립이 왜 데 이 될 수 있습니다.Newtonsoft.Json로드할 수 없습니다.

=== Pre-bind state information ===
LOG: DisplayName = Newtonsoft.Json
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Newtonsoft.Json | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///c:/users/user/documents/visual studio 2013/Projects/foo/bar/
LOG: Initial PrivatePath = c:\users\user\documents\visual studio 2013\Projects\foo\bar\bin
Calling assembly : (Unknown).
 ===
LOG: This bind starts in default load context.
LOG: Using application configuration file: c:\users\user\documents\visual studio 2013\Projects\foo\bar\web.config
LOG: Using host configuration file: C:\Users\user\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/user/AppData/Local/Temp/1/Temporary ASP.NET Files/root/48686d37/9d7a6572/Newtonsoft.Json.DLL.
LOG: Attempting download of new URL file:///C:/Users/user/AppData/Local/Temp/1/Temporary ASP.NET Files/root/48686d37/9d7a6572/Newtonsoft.Json/Newtonsoft.Json.DLL.
LOG: Attempting download of new URL file:///c:/users/user/documents/visual studio 2013/Projects/foo/bar/bin/Newtonsoft.Json.DLL.
LOG: Using application configuration file: c:\users\user\documents\visual studio 2013\Projects\foo\bar\web.config
LOG: Using host configuration file: C:\Users\user\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Redirect found in application configuration file: 4.5.0.0 redirected to 6.0.1.0.
LOG: Post-policy reference: Newtonsoft.Json, Version=6.0.1.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
LOG: Attempting download of new URL file:///C:/Users/user/AppData/Local/Temp/1/Temporary ASP.NET Files/root/48686d37/9d7a6572/Newtonsoft.Json.DLL.
LOG: Attempting download of new URL file:///C:/Users/user/AppData/Local/Temp/1/Temporary ASP.NET Files/root/48686d37/9d7a6572/Newtonsoft.Json/Newtonsoft.Json.DLL.
LOG: Attempting download of new URL file:///c:/users/user/documents/visual studio 2013/Projects/foo/bar/bin/Newtonsoft.Json.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

스택 트레이스:

[FileLoadException: Could not load file or assembly 'Newtonsoft.Json' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]

[FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.1.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
       System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
       System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +34
       System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
       System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
       System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +16
       System.Reflection.Assembly.Load(String assemblyString) +28
       System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38

[ConfigurationErrorsException: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.1.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
       System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +752
       System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +218
       System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
        System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
       System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +91
       System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +285
       System.Web.Compilation.BuildManager.ExecutePreAppStart() +153
       System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516

[HttpException (0x80004005): Could not load file or assembly 'Newtonsoft.Json, Version=6.0.1.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9913572
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18408

이를 해결하기 위해 다음 명령을 실행하고 결과를 확인함으로써 모든 프로젝트가 동일한 버전을 사용하도록 했습니다.

update-package Newtonsoft.Json -reinstall

마지막으로 web.config에서 다음 항목을 삭제했습니다.

  <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>

모든 뉴턴소프트를 확실히 하고 싶다면.Json 패키지는 동일한 버전입니다. 다음과 같이 버전을 지정할 수 있습니다.

update-package Newtonsoft.Json -version 6.0.0 -reinstall

주의: Visual Studio에서 PMC를 열려면 [Tools]-> [ Nuget Package Manager ]-> [ Package Manager Console ]을 클릭합니다.고마워 @rose!

저는 뉴턴소프트를 사용하고 있습니다.Json v6.0.3. 단, Web.config 파일에서 해야 할 작업은 다음과 같습니다.

<dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="6.0.0.0" />
</dependentAssembly>

6 6.0.3을 삽입해야 .newVersion="6.0.0.0"

packages.config 파일에는 다음과 같은 파일이 있습니다.

<package id="Newtonsoft.Json" version="6.0.3" targetFramework="net45" />

컴퓨터가 모든 위치에서 동일한 버전을 가지고 있는지, 그리고 프로젝트가 모두 동일한 참조 경로를 가리키고 있는지 확인한 후 다음을 시도했습니다.또한 이전 버전의 바인딩이 현재 버전의 dll에 바인딩되어 있는지 확인했습니다.

저는 엄격한 프레임워크 환경에서 작업하고 있으며 프레임워크 팀은 종종 다른 dll을 사용한 버전 관리를 방해합니다.

이 문제를 해결한 방법은 Visual Studio(2013) 내에서 패키지 매니저 콘솔을 실행하는 것입니다.여기서 다음 명령을 실행했습니다.

update-package Newtonsoft.Json -reinstall

이어서

update-package Newtonsoft.Json

이것으로 모든 설정 파일과 관련 프로젝트 파일이 갱신되었습니다.모든 것을 같은 버전의 dll로 강제합니다.최신 버전을 얻기 위해 다시 업데이트하기 전 버전 4.5였습니다.

같은 에러 메세지가 있었습니다만, 말씀하신 것처럼, 뉴턴 소프트의 버전이 다른 것이 원인입니다.참조되고 있는 Json.dll.

MVC 솔루션의 일부 프로젝트에서는 해당 dll 버전4에 NuGet 패키지를 사용했습니다.

그리고 뉴턴소프트를 가져온 NuGet 패키지(내 경우 Salesforce용)를 추가했습니다.Json 버전 6은 프로젝트 중 하나에 종속되어 있습니다.그것이 나에게 문제를 일으킨 계기가 되었다.

문제를 해결하기 위해 NuGet Package Manager의 Updates 섹션을 사용하여 솔루션(툴 메뉴 또는 솔루션 오른쪽 클릭 제외)을 업데이트했습니다.솔루션 전체에 넷 패키지가 제공되므로 모든 프로젝트에서 동일한 버전입니다.

그 후 App Config 파일을 확인하고 바인딩 리다이렉트 행이 아래와 같이 선택한 버전으로 되어 있는지 확인했습니다.

<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />

좋아, 이제 된 것 같아.뉴튼소프트는 다 지웠어요Json.dll은 제가 찾을 수 있는 최신 버전이 아니라 NuGet에 최신 버전이 있는지 확인하고 빌드하여 bin 폴더에 최신 버전이 있는지 확인하고 web.config와 .csproj에 변경을 남겨두었습니다.이제 또 다른 오류가 발생했으므로 작동해야 합니다.

몇 시간 동안 고생하다가...다음을 수행했습니다.

web.config

<runtime>

  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

    <dependentAssembly>
      <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
      <bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
    </dependentAssembly>

    <!-- other assemblies... -->

  </assemblyBinding>
</runtime>

및 의 "newVersion" oldVersion"을 여는 입니다.References하거나 [ ]을 클릭합니다.alt + enter

코너가 Version제 경우엔12.0.0.0실제로는12.0.3Manage NuGet을 관리하다

참조이는 " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " ."12.0.0.0)

ㅇㅇㅇㅇㅇ.clean ★★★★★★★★★★★★★★★★★」rebuild를 할 수 )bin ★★★★★★★★★★★★★★★★★」obj폴더)를 참조해 주세요.

다른 패키지의 의존성 문제에 직면할 수 있습니다.모두에게 그렇게 해줬더니 효과가 있었습니다.

이 부분을 web.config에 코멘트함으로써 문제를 해결했습니다.

<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>

그러나 패키지 매니저 콘솔에서 다음을 수행하여 업데이트가 완료되었는지 또는 버전이 올바른지 확인해야 합니다.

update-package Newtonsoft.Json -reinstall

이 문제는 web.config 파일에 다음 행을 추가하여 해결할 수 있습니다.

 <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

제 경우, 그건 단지 다음과 같은 문제였습니다.

Tools -> NuGet Package Manager -> Package Manager Settings -> Clear Cache

TFS 폴더를 다시 매핑했을 때 문제가 발생했습니다.

올레그의 스텝을 시험해 봤는데, 같은 상황에서 효과가 있었어요.

순서:

  1. 실행합니다.update-package Newtonsoft.Json -reinstall[ Package Manager ]패키지 매니저

  2. bin하여 ""를 bin더입니니다다

  3. Visual Studio를 닫았다가 다시 엽니다.

  4. 이제 프로젝트를 다시 실행하십시오.난 괜찮을 거라고 생각해!

실제로 도움이 된 것은 Resharper 빌드를 끄고 프로젝트에서 Visual Studio Re-Build 옵션을 사용하는 것이었습니다.

[툴(Tools)]> [ NuGet Package Manager ]> [ 솔루션 업데이트용 패키지 관리(Manage Package for Solution Update Newtonsoft)]에서 선택합니다.최신 버전의 모든 솔루션 Json

만약 당신이 어떤 종류의 전복에 대해 작업하고 있다면: 프로젝트를 삭제하고 다시 복구하면, 그것은 나에게 효과가 있었다.s

MVC 5 프로젝트와 관련된 테스트 프로젝트에서도 같은 문제가 있었습니다.이것은 MVC 5 프로젝트와 합병한 후의 일입니다.여기 Andre의 답변에 설명된 대로 Visual studio 2012 업데이트를 설치하여 수정했습니다.

  • 비주얼 스튜디오에서
    1. 도구 > 확장 및 업데이트
    2. 왼쪽 아코디언 목록에서 "업데이트"를 선택합니다.
    3. "제품 업데이트"를 선택합니다.
    4. 최신 버전으로 업데이트

이유는 모르겠지만 제 경우 프로젝트에서 bin 폴더를 삭제해도 프로젝트를 빌드하면 이전 버전의 newtonsoft.json이 복사되고 패키지 폴더에서 새 버전의 dll이 복사되어 해결됩니다.

이 중 어느 것도 효과가 없는 경우는, 다음의 회답을 확인해 주세요.

https://stackoverflow.com/a/12011221/150370

(TL;DR: xml 이름 공간 제거configuration태그를 지정합니다.그렇지 않으면 바인딩된 리다이렉트는 무시됩니다.)

, 「」를 , 「」가 됩니다.Bin ★★★★★★★★★★★★★★★★★」Obj이치노

좋아요, 그럼 여기서 제 답변을 이 긴 목록에 추가하는 것이 중복 질문을 만드는 것보다 더 좋을 것 같습니다.

2019년에 이것을 입수하는 경우는, 을 참조해 주세요.NET Core 3.0(현시점에서는 미리보기), 솔루션은 모든 프로젝트가 같은 타깃이 되도록 하는 것입니다.NET Core 버전(이 경우는 3.0).솔루션 2.1을 대상으로 한 프로젝트가 하나 있고 나머지는 2.2였으므로 2.2를 고수할 수 있었을 것 같습니다.

난 뉴턴소프트도 없어어느 프로젝트에나 Json이 설치되어 자연스레 Json을 추가해도 문제가 해결되지 않았습니다.

가 있는 경우.NET Standard 클래스 라이브러리 또는 솔루션에 포함되어 있지 않은 경우, 같은 버전을 사용할 필요는 없습니다.다만, 최신 버전일 수도 있습니다.예를 들어, 내.가 없기 때문에, NET Standard 클래스 라이브러리는 2.2 에 있습니다.NET Standard 3.0은 아직 없습니다.

체크한 답변을 포함하여 어떤 답변도 나에게는 효과가 없었다.

해결책은 훨씬 더 간단했다.먼저 BUS 레이어에서 참조를 삭제했습니다.그런 다음 프로젝트에서 dll을 삭제하고(삭제되었는지 확인), JSON을 다시 설치했습니다.nuget packeges의 NET.그리고 어려운 부분은 '끄고 또 켜는' 거였어요.

방금 비주얼 스튜디오를 다시 시작했는데 작동했어요!

따라서 가능한 모든 방법을 동원해도 문제를 해결할 수 없는 경우에는 비주얼 스튜디오를 껐다가 다시 켜면 도움이 될 수 있습니다.

bin 폴더의 Newtonsoft.json.dll 하위 버전을 삭제하고 Newtonsoft.json.dll V6.0.0을 추가하여 다음 web.config 요소를 삭제했습니다.

<dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"/>
    <bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="5.0.8"/>
</dependentAssembly>

dotnet core에서도 같은 문제가 발생하여 NuGet 캐시를 클리어하여 수정하였습니다.

powershell을 열고 다음 명령을 입력합니다.

dotnet nuget locals all --clear

그런 다음 Visual Studio를 닫고 다시 열고 Package Manager Console에 다음 명령을 입력했습니다.

Update-Package

이제 NuGet은 모든 패키지를 복원하고 Nuget 캐시를 다시 팝합니다.

그 후 Linux 컨테이너에서 dotnet core webapi를 빌드하고 시작할 수 있었습니다.

이 문제를 해결한 해결책은

goto references -> newtonsoft.json - 속성을 클릭하여 버전을 확인합니다.

동일한 버전이 에 있어야 합니다.

<dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-YourDllVersion" newVersion="YourDllVersion" />
</dependentAssembly>

쉬운 단계 (1) "update-package Newtonsoft"를 실행합니다.패키지 관리자에서 Json -reinstall"을 클릭합니다.

(2) 숨김 파일을 표시하고 bin 폴더를 삭제하여 bin을 삭제합니다.

(3)시각 스튜디오를 닫았다가 다시 엽니다.

(4) 이제 프로젝트를 다시 실행합니다.난 괜찮을 거라고 생각해

이 문제는 프로젝트A(데스크탑.exe)는 프로젝트B(노트북.dll)를 말합니다.A와 B는 JSON 버전이 달랐어요.넷, 그래서 로더 충돌이 있었어요.JSON.net의 모든 버전을 동일하게 만들자, 작동했습니다.(이것은 실제로 위의 솔루션 중 일부에서 실시되고 있는 것입니다.실제로 동작하는 이유를 설명하고 있을 뿐입니다.)

저는 최근에 오래된 프로젝트와 관련하여 어려움을 겪었습니다.

실제로 bin 폴더에 있는 dll의 버전을 확인한 후 문제를 추적할 수 있었습니다.

dll 라이브러리 폴더에서 bin 폴더로 종속 어셈블리를 복사하는 빌드 후 스크립트가 있었습니다.Nuget 이전부터의 일반적인 설정입니다.

따라서 빌드 후 스크립트를 작성할 때마다 올바른 버전의 Json.net이 이전 버전으로 교체되었습니다.

똑같은 문제가 발생했는데 Visual Studio 13의 기본 라이브러리는 4.5였습니다.그 때문에, 2개의 해결 방법이 있습니다.webconfig 파일에서 이것을 참조해 주세요.그것은 최후의 수단이고 효과가 있다.

오류 메시지는 이 위치 /Projects/foo/bar/bin/Newtonsoft에 문제가 있음을 나타냅니다.DLL이 있는 Json.DLL!기본 속성 체크 결과 4.5.0.0 또는 동등하다고 나와 있었기 때문에 4.5를 사용하도록 webconfig를 변경했습니다.

이 옵션들 중 어느 것도 나에게는 통하지 않았다.결국 그것은 효과가 있었다.

Test > Test Settings > *.testrunconfig

나는 새 줄을 추가해야 했다.

<DeploymentItem filename="packages\Newtonsoft.Json.4.5.8\lib\net40\Newtonsoft.Json.dll" />

경로와 버전이 설정에 맞는지 확인하십시오.

저도 같은 문제가 있었어요.웹 API 프로젝트를 만들고 .net 4.5.1에서 .net 4.6.1로 업그레이드했습니다.IDE 닫기, IIS 중지 및 C 콘텐츠 삭제:\Windows\Microsoft.NET\Framework\v4.0.30319\임시 ASPNET Files\dir는 문제를 해결했다.

HTH

이 문제는 NuGet 패키지를 갱신하거나 프로젝트에서 "Clean"을 실행해도 해결되지 않았습니다.이 문제는 "obj" 폴더를 수동으로 지우는 것으로 해결되었습니다.

여기 이 문제에 대한 해결책이 있습니다. appconfig 또는 packageconfig의 버전 번호가 레퍼런스 버전과 동일한지 확인하십시오.여기를 참조해 주세요.

언급URL : https://stackoverflow.com/questions/22685530/could-not-load-file-or-assembly-newtonsoft-json-or-one-of-its-dependencies-ma

반응형