2

I had a framework project that had a reference to a vcxproj project. I converted this project to a .netstandard2.0 project, using sdk-style projects. Now, I get an error about missing project info.

How can my standard project reference a c++ project such that they both get compiled in dependency order. Is this supported?

C:\Program Files\dotnet\sdk\2.1.513\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(129,5): error NETSDK1007: Cannot find project info for 'd:\depot\master4\private\mt\common\UnicodeNormalizer\UnicodeNormalizer.vcxproj'. This can indicate a missing project reference.

<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>
Fai
  • 389
  • 2
  • 14

1 Answers1

0

I found a work-around that looks like this. This does build the project and places the produced dll in the output of this project. Note this won't build on linux. dotnet can't parse the vcxproj file.

  <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>
Fai
  • 389
  • 2
  • 14