Closed BrianDT closed 5 years ago
Should have said its a simple uap10.0 sample project
<Project Sdk="MSBuild.Sdk.Extras/1.6.65">
<PropertyGroup>
<TargetFramework>uap10.0</TargetFramework>
<TargetPlatformVersion>10.0.17134.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\SdkP1.UWP\SdkP1.UWP.csproj" />
</ItemGroup>
</Project>
Unfortunately, this is a bug in the VS tooling. It cannot add a reference to a multi-targeted project in the UI. As a workaround, you can add it manually in the project file as XML using the ProjectReference
item.
Please file an issue on the Report a Problem tool in VS to help get more attention to it.
@ridomin
Hi Oren,
Would you mind clarifying a bit, because I feel that there must be more than just multi-targeting that is causing the issue.
If I have a project like
This has no problem adding the project reference in the UI.
Or am I misinterpreting what is implied by ‘multi-targeted’?
Thanks Brian
Sent from Mail for Windows 10
From: Oren Novotny Sent: 26 December 2018 14:53 To: onovotny/MSBuildSdkExtras Cc: Brian; Author Subject: Re: [onovotny/MSBuildSdkExtras] Error message when adding referencesin VS2017 UI (#144)
Unfortunately, this is a bug in the VS tooling. It cannot add a reference to a multi-targeted project in the UI. As a workaround, you can add it manually in the project file as XML using the ProjectReference item. @ridomin — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
@BrianDT
I haven't fully tested whether this screws things up later down the line.... but I added the following 'Directory.Build.Props' to my local copy of Prism in the 'Windows10' folder. I have several extensions I've written and the above bugged the hell out of me!!!! Add Reference now works and everything 'appears' to compile correctly.... :)
`
<PropertyGroup>
<TargetPlatformWinMDLocation>C:\Program Files (x86)\Windows Kits\10\UnionMetadata</TargetPlatformWinMDLocation>
</PropertyGroup>
`
The suggestion to define the WinMDLocation is a good one. Doesn’t look like it will work as defined above in a MSBuild.Sdk.Extras style project, but there is no problem adding the line-
Directly into the project file, and this does resolve the issue. Wonder why this was not done automatically when defining the target framework as uap10.0
Adding project references in the project file is fine but trying to add them in the VS 2017 UI generates an error. Right click on Dependencies and select ‘Add Reference …’ and the error ‘Missing value for TargetPlatformMDLocation property’ is displayed.