突然之间,我在一个解决方案中的3个项目中得到了以下错误:
Error NU1105 Unable to find project information for 'C:\code\example\src\libs\example.I18n\example.I18n.csproj'.
The project file may be invalid or missing targets required for restore.
在这个项目中唯一改变的就是一些DB的改变,但是我在过去从来没有遇到过任何问题。唯一的另一件事是我更新到了Visual Studio 2017 15.5。这会引起问题吗?
我已经尝试从源代码管理中删除和重新克隆解决方案,但仍然收到错误。我同事的机器上没有问题,所以一定是本地的东西。
其中一个.csproj文件的示例(如果这有帮助):
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net452</TargetFramework>
<AssemblyName>Example.I18n</AssemblyName>
<PackageId>Example.I18n</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.1" />
<PackageReference Include="MessageFormat" Version="1.0.1" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
</Project>
发布于 2020-08-28 07:29:59
我得到这个错误错误NU1105:找不到'C:\folder2\project1.csproj‘的项目信息。但是我作为解决方案的一部分的project1位于C:\folder1\project1.csproj中(它也在c:\folder2\project1.csproj中,但不是解决方案的一部分,所以它很混乱),一旦我将引用更改为项目的正确位置,它就可以工作了。
https://stackoverflow.com/questions/47695504
复制相似问题