it-source

'뉴턴소프트''Json...'은(는) 'Blend\Newtonsoft'에 모두 있습니다.Json.dll' 및 '솔루션\패키지\...\

criticalcode 2023. 8. 4. 23:08
반응형

'뉴턴소프트''Json...'은(는) 'Blend\Newtonsoft'에 모두 있습니다.Json.dll' 및 '솔루션\패키지\...\

Visual Studio 2013에서는 솔루션을 구축할 수 없습니다.

JSON을 업데이트한 후에 이런 일이 발생했습니다.NET 패키지에서 6.0.1로 이동합니다.그 전에는, 그것은 매력적으로 작동했습니다.

아이디어 있어요?

PS: 아마도 OWIN에 관한 것일 것입니다.이것은 JSON을 참조합니다.NET도 역동적으로 생각합니다.

전체 오류

Error   11  The type 'Newtonsoft.Json.Linq.JObject' exists in both 
'c:\Program Files (x86)\Microsoft Visual Studio 12.0\Blend\Newtonsoft.Json.dll' and
'c:\Users\Me\Desktop\Solutions\[Project]\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll'
C:\Users\Me\Desktop\Solutions\[Project]\TrendPin\App_Start\Startup.Auth.cs  48  21  [Project]

제 웹에 이것이 있습니다.구성

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

내 .csproj에 이것이 있습니다.

<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>

빌드 출력

1>------ Build started: Project: [Project].Backend, Configuration: Debug Any CPU ------
1>  All packages listed in packages.config are already installed.
1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1635,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed.
1>  [Project].Backend -> C:\Users\Me\Desktop\Solutions\[Project]\[Project].Backend\bin\Debug\[Project].Backend.dll
2>------ Build started: Project: [Project].Data, Configuration: Debug Any CPU ------
2>  All packages listed in packages.config are already installed.
2>  [Project].Data -> C:\Users\Me\Desktop\Solutions\[Project]\[Project].Data\bin\Debug\[Project].Data.dll
3>------ Build started: Project: [Project], Configuration: Debug Any CPU ------
3>  All packages listed in packages.config are already installed.
3>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1635,5): warning MSB3243: No way to resolve conflict between "Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" and "Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed". Choosing "Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" arbitrarily.
3>  Consider app.config remapping of assembly "Newtonsoft.Json, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" from Version "4.5.0.0" [C:\Program Files (x86)\Microsoft Visual Studio 12.0\Blend\Newtonsoft.Json.dll] to Version "6.0.0.0" [C:\Users\Me\Desktop\Solutions\[Project]\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll] to solve conflict and get rid of warning.
3>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1635,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file: <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" /><bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /></dependentAssembly></assemblyBinding>
3>C:\Users\Me\Desktop\Solutions\[Project]\[Project]\App_Start\Startup.Auth.cs(48,21,48,28): error CS0433: The type 'Newtonsoft.Json.Linq.JObject' exists in both 'c:\Program Files (x86)\Microsoft Visual Studio 12.0\Blend\Newtonsoft.Json.dll' and 'c:\Users\Me\Desktop\Solutions\[Project]\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll'
4>------ Skipped Build: Project: [Project].Tests, Configuration: Debug Any CPU ------
4>Project not selected to build for this solution configuration 
========== Build: 2 succeeded, 1 failed, 0 up-to-date, 1 skipped ==========

csproj 파일에는 뉴턴소프트에 대한 항목이 2개 있습니다.Json. 다음 항목을 제거합니다.

<Reference Include="Newtonsoft.Json">
    <HintPath>..\packages\Newtonsoft.Json.5.0.6\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>

반영할 수 있습니다.owin참고 자료에서 무엇을 찾고 있는지 확인합니다.특정 버전을 찾으면 문제가 발생하지만, 그렇지 않으면 원하는 버전을 애플리케이션 보관함에 함께 넣으십시오.owin서명이 일치하기를 바랍니다.또한 GAC가 있다는 것을 기억하세요.그래서, 당신은 실험의 여지가 있습니다.

저는 병합을 한 후 거의 같은 문제를 겪었습니다.합병은 뉴턴소프트에 대한 두 가지 언급을 남겼습니다.csproj 파일의 Json.프로젝트에는 DLL에 있었고 NuGet 패키지 관리자에는 하나의 버전만 있었지만 csproj는 Newtonsoft를 참조했습니다.Jason 5.0.6 및 5.0.8

나는 노트패드++에서 csproj를 편집하고 문제가 되는 참조인 et voila를 제거했습니다.빌드 오류를 해결했습니다.

언급URL : https://stackoverflow.com/questions/21653130/newtonsoft-json-exists-in-both-blend-newtonsoft-json-dll-and-solution-pa

반응형