dotnet / dotnet/msbuild

UWP - Unable to exclude the referenced projects in the PRI file generation

Open
#5,289 1 comment 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### Steps to reproduce

In my UWP solution, I have a ClassLibrary1 project (with a BlankPage1.xaml) and a ClassLibrary2 project that references the ClassLibrary1 project (with a BlankPage2.xaml).

I want to be able to do 2 NuGet packages (one for ClassLibrary1 and another for the ClassLibrary2).
The problem is when I generate the library layout for ClassLibrary2, it also include the BlankPage1.xaml of the ClassLibrary1. How can I indicate to not include the ressources of ClassLibrary1 in the ClassLibrary2.pri file ?

This is a [sample project](https://github.com/kakone/PriGeneration/) that reproduces the problem. If you compile the PriGeneration project, it will fail with these errors (because theses 3 files are not included in the ClassLibrary2 NuGet package) :
```
Error: Could not copy the file "C:\Users\xxx\.nuget\packages\classlibrary2\1.0.0\lib\uap10.0.16299\ClassLibrary1\BlankPage1.xbf" because it was not found.
Error: Could not copy the file "C:\Users\xxx\.nuget\packages\classlibrary2\1.0.0\lib\uap10.0.16299\ClassLibrary1\BlankPage1.xaml" because it was not found.
Error: Could not copy the file "C:\Users\xxx\.nuget\packages\classlibrary2\1.0.0\lib\uap10.0.16299\ClassLibrary1\ClassLibrary1.xr.xml" because it was not found.
```

### Expected behavior
To have an option to not include the referenced projects in the PRI file generation.

### Actual behavior
The generated library layout always include all the resources of the referenced projects.

### Environment data
`msbuild /version` output: 16.5.0.12403

OS info:
Visual Studio 16.5.4

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.