code

모든 참조가 누락 된 Visual Studio 2015 프로젝트

codestyles 2021. 1. 5. 08:06
반응형

모든 참조가 누락 된 Visual Studio 2015 프로젝트


오늘부터 20 개의 프로젝트가있는 솔루션에 속한 WPF 프로젝트에서 모든 참조를 missing으로 설정합니다.

여기에 이미지 설명 입력

방금 MS 제안과 Stackoverflow에 대한 다른 답변을 확인했지만 아무것도 작동하지 않았습니다 ... 운없이 SVN에서 솔루션을 다시 얻으려고 시도했지만 다른 동료는이 문제가 없습니다. 또한 참조 (예 : System.Xml)를 제거하고 다시 추가하려고했습니다. 하지만 작동시킬 방법이 없습니다 ...

어떠한 제안? 감사

업데이트 # 1

여기 csproj가 있습니다.

 <ItemGroup>
<Reference Include="Catel.Core, Version=4.2.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\packages\Catel.Core.4.2.0\lib\net40\Catel.Core.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Catel.Extensions.Controls, Version=4.2.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\packages\Catel.Extensions.Controls.4.2.0\lib\net40\Catel.Extensions.Controls.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Catel.Extensions.FluentValidation, Version=4.2.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\packages\Catel.Extensions.FluentValidation.4.2.0\lib\net40\Catel.Extensions.FluentValidation.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Catel.Fody.Attributes, Version=2.8.0.0, Culture=neutral, PublicKeyToken=1c8163524cbe02e6, processorArchitecture=MSIL">
  <HintPath>..\packages\Catel.Fody.2.8.0\lib\portable-net4+sl4+wp7+win8+wpa81+MonoAndroid14+MonoTouch40\Catel.Fody.Attributes.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Catel.MVVM, Version=4.2.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\packages\Catel.MVVM.4.2.0\lib\net40\Catel.MVVM.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="MethodTimer, Version=1.15.7.0, Culture=neutral, PublicKeyToken=cb1364609f40a1dc, processorArchitecture=MSIL">
  <HintPath>..\packages\MethodTimer.Fody.1.15.7.0\Lib\portable-net4+sl5+wp8+win8+wpa81+MonoAndroid16+MonoTouch40\MethodTimer.dll</HintPath>
  <Private>False</Private>
</Reference>
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
  <HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
  <HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop, Version=1.0.168.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
  <HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="ServiceStack">
  <HintPath>..\packages\ServiceStack.4.0.46\lib\net40\ServiceStack.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="ServiceStack.Client, Version=4.0.46.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\packages\ServiceStack.Client.4.0.46\lib\net40\ServiceStack.Client.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="ServiceStack.Common">
  <HintPath>..\packages\ServiceStack.Common.4.0.46\lib\net40\ServiceStack.Common.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="ServiceStack.Interfaces, Version=4.0.0.0, Culture=neutral, PublicKeyToken=e06fbc6124f57c43, processorArchitecture=MSIL">
  <HintPath>..\packages\ServiceStack.Interfaces.4.0.46\lib\portable-wp80+sl5+net40+win8+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="ServiceStack.Text, Version=4.0.46.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\packages\ServiceStack.Text.4.0.46\lib\net40\ServiceStack.Text.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.IO, Version=2.6.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
  <HintPath>..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.IO.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="System.Management" />
<Reference Include="System.Net" />
<Reference Include="System.Runtime, Version=2.6.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
  <HintPath>..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.Runtime.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="System.Threading.Tasks, Version=2.6.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
  <HintPath>..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.Threading.Tasks.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
  <HintPath>..\packages\Catel.MVVM.4.2.0\lib\net40\System.Windows.Interactivity.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="Telerik.Windows.Controls, Version=2015.2.728.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
  <HintPath>..\packages\Telerik.Windows.Controls.for.Wpf.40.Xaml.2015.2.728\lib\net40\Telerik.Windows.Controls.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Telerik.Windows.Controls.GridView, Version=2015.2.728.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
  <HintPath>..\packages\Telerik.Windows.Controls.GridView.for.Wpf.40.Xaml.2015.2.728\lib\net40\Telerik.Windows.Controls.GridView.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Telerik.Windows.Controls.Input, Version=2015.2.728.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
  <HintPath>..\packages\Telerik.Windows.Controls.Input.for.Wpf.40.Xaml.2015.2.728\lib\net40\Telerik.Windows.Controls.Input.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Telerik.Windows.Controls.Navigation, Version=2015.2.728.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
  <HintPath>..\packages\Telerik.Windows.Controls.Navigation.for.Wpf.40.Xaml.2015.2.728\lib\net40\Telerik.Windows.Controls.Navigation.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Telerik.Windows.Data, Version=2015.2.728.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
  <HintPath>..\packages\Telerik.Windows.Data.for.Wpf.40.Xaml.2015.2.728\lib\net40\Telerik.Windows.Data.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="UIAutomationProvider" />
<Reference Include="UIAutomationTypes" />
<Reference Include="WindowsBase" />

예, Nuget을 사용합니다. 다른 19 개 포인트는 동일한 어셈블리를 가리 킵니다.

업데이트 # 2

진행할 수 없었기 때문에 동료로부터 프로젝트를 복사했고 이제 작동합니다 .... 파일 시스템에서 뭔가 잘못되었다고 생각합니다 ... 솔루션을 비교했는데 그들은 동일했습니다.


이 문제에 대한 해결책은 다음과 같습니다.

Whenever you import a project to VS 2015 it modifies your .csproj. So, in order to fix it. Right click on .csproj and open it in notepad or any editor and delete the following

<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
  <PropertyGroup>
    <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
  </PropertyGroup>
  <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>

Then build your solution and it should work.


In the root directory of the solution, delete everything inside of /packages/ folder, then do a re-build.


I had this once, caused by a broken .targets import. Check if you accidentally enabled nuget package restore (which includes a .targets file) and then deleted the .nuget directory.


It can help to force rebuild the nuget packages. Go to the nuget console and use the following commands: (TOOLS > Options > Package Manager > Package Manager Conbsole)

Update-Package -reinstall -ProjectName "MyProject" -safe

The safe parameter will actually not update the packages, but only reinstall them. If that didn't help, you can try to actually update them (but make sure you have a copy of the project somewhere, just in case.)

Update-Package -reinstall -ProjectName "MyProject"

To force update just one package, use:

Update-Package -id Microsoft.Package.Name -ProjectName "MyProject"

I had similar issue. The solution, which worked for me was to pop the nuget package manager for the solution and refresh the packages.

Another case involved missing packages and nuget package manager for the solution showed updates and dependencies, which needed to be installed and this was the fix.

Another case was exactly as pointed above - delete packages folder fixed it.

Editing manually the project is an option, but there is a chance if you poke where you are not supposed to, your project may not open. If you can, avoid doing that is my opinion.


I've just experienced exactly this in VS2015 on a solution with around 20 projects. Only one project was affected and it lost all references including to the standard .NET assemblies.

The only way I could resolve was to switch to a different GIT branch and then back, this cleaned up the issue and it is all now working.


I also experienced exactly this in VS2015 on a solution with around 10 projects. Only one project - the main MVC project - was affected and it lost all references including to the standard .NET assemblies.

The problem was in my web.config. I had commented some lines, resulting in an invalid xml-file.


This error may occur if you miss .targets file in nuget packages folder. In my case it was packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets

일반적으로 git 저장소에 패키지를 추가 .gitignore하고 (공통 파일은 모든 곳에서 빌드 폴더를 무시 함) 다른 컴퓨터에서 체크 아웃 할 때 발생 합니다.

팁 : 폴더의 .gitignore모든 파일을 포함 하도록 파일을 수정할 수 있습니다 packages. 다음 줄을 맨 아래에 추가하십시오.

# Include all files in NuGet packages directory
!/packages/**/

프로젝트를 언로드 한 다음 프로젝트 편집

다음을 찾아 삭제하십시오.

이 프로젝트는이 컴퓨터에없는 NuGet 패키지를 참조합니다. NuGet 패키지 복원을 활성화하여 다운로드합니다. 자세한 내용은 http://go.microsoft.com/fwlink/?LinkID=322105를 참조하십시오 . 누락 된 파일은 {0}입니다.

참조 URL : https://stackoverflow.com/questions/33694515/visual-studio-2015-project-missing-all-references

반응형