我有一个框架项目,该项目引用了vcxproj项目。我使用sdk样式的项目将此项目转换为.netstandard2.0项目。现在,我收到有关缺少项目信息的错误消息。
我的标准项目如何引用c ++项目,以使它们都按依赖关系顺序进行编译。支持吗?
C:\ Program Files \ dotnet \ sdk \ 2.1.513 \ Sdks \ Microsoft.NET.Sdk \ targets \ Microsoft.NET.Sdk.targets(129,5):错误NETSDK1007:找不到'd的项目信息:\ depot \ master4 \ private \ mt \ common \ UnicodeNormalizer \ UnicodeNormalizer.vcxproj'。这可能表明缺少项目参考。
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Configurations>Debug;Release;</Configurations>
<SignAssembly>true</SignAssembly>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Platforms>x64</Platforms>
<ProjectGuid>{f7af5355-9510-42df-baf6-01748e9dc625}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>0618</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(EnlistmentRoot)\private\mt\common\UnicodeNormalizer\UnicodeNormalizer.vcxproj"/>
</ItemGroup>
</Project>
答案 0 :(得分:0)
我找到了一个看起来像这样的解决方法。这确实构建了项目并将生成的 dll 放置在该项目的输出中。请注意,这不会在 linux 上构建。 dotnet 无法解析 vcxproj 文件。
<ItemGroup>
<ProjectReference Include="$(EnlistmentRoot)\private\mt\common\UnicodeNormalizer\UnicodeNormalizer.vcxproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<OutputItemType>Content</OutputItemType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Targets>Build;DebugSymbolsProjectOutputGroup</Targets>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="$(EnlistmentRoot)\private\mt\common\UnicodeNormalizer\$(ProjectOutputPath)\UnicodeNormalizer.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
</None>
</ItemGroup>