加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – .NET核心项目参考问题 – “无法找到’XXX.csproj’的项目

发布时间:2020-12-15 22:45:00 所属栏目:百科 来源:网络整理
导读:我有一个针对.NET Framework 4.5.2的ASP.NET核心Web应用程序(.NET Framework). 添加对“类库(.NET Framework)”类型的空类库的引用后,将显示以下错误: “Cannot find project info for ‘XXX.csproj’. This can indicate a missing project reference.” B
我有一个针对.NET Framework 4.5.2的ASP.NET核心Web应用程序(.NET Framework).

添加对“类库(.NET Framework)”类型的空类库的引用后,将显示以下错误:

“Cannot find project info for ‘XXX.csproj’. This can indicate a
missing project reference.” Below you can see a screenshot of the
error.

这是我的项目文件:

<Target Name="GenerateBuildDependencyFile" 
    DependsOnTargets="_DefaultMicrosoftNETPlatformLibrary" 
    BeforeTargets="_CheckForCompileOutputs" 
    Condition=" '$(GenerateDependencyFile)' == 'true'" 
    Inputs="$(ProjectAssetsFile)" 
    Outputs="$(ProjectDepsFilePath)"> 

<GenerateDepsFile ProjectPath="$(MSBuildProjectFullPath " 
                    AssetsFilePath="$(ProjectAssetsFile)" 
                    DepsFilePath="$(ProjectDepsFilePath)" 
                    TargetFramework="$(TargetFrameworkMoniker)" 
                    AssemblyName="$(AssemblyName)" 
                    AssemblyExtension="$(TargetExt)" 
                    AssemblyVersion="$(Version)" 
                    AssemblySatelliteAssemblies="@(IntermediateSatelliteAssembliesWithTargetPath)" 
                    ReferencePaths="@(ReferencePath)" 
                    ReferenceSatellitePaths="@(ReferenceSatellitePaths)" 
                    RuntimeIdentifier="$(RuntimeIdentifier)" 
                    PlatformLibraryName="$(MicrosoftNETPlatformLibrary)" 
                    CompilerOptions="@(DependencyFileCompilerOptions)"> 
</GenerateDepsFile> 
<ItemGroup>     
    <FileWrites Include="$(ProjectDepsFilePath)" Condition="Exists('$(ProjectDepsFilePath)')"/> 
</ItemGroup> 
</Target>

Source of the project file
我在互联网上搜索了一个解决方案,发现它可能与项目之间的传递依赖关系有关.如果A – >; B – > C然后A – > C.但我只有一个.NET Core项目和一个空的类库.

解决方法

为我解决这个问题的是将目标框架从4.5.2更改为4.6.1,如果有人应该遇到相同的:)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读