New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pack target misses .pri files for Windows targets when multitargeting #4136

Closed
srivatsn opened this Issue Dec 21, 2016 · 20 comments

Comments

Projects
None yet
4 participants
@srivatsn

srivatsn commented Dec 21, 2016

Moved from dotnet/sdk#508 filed by @onovotny

When using msbuild /t:pack to generate a NuPkg on a multi-targeted project that includes Windows outputs (uap10.0, win8, wpa81, etc) that also contain a .pri file, the generated NuSpec used to create the package does not include the .pri file. That will lead to errors loading resources.

To repro:
Check out this commit from Zeroconf:
https://github.com/onovotny/Zeroconf/tree/39d47e8fea22a1eb19938392e0bc8f903181cf02

Run the following command msbuild /t:pack /p:Configuration=Release

Look at the NuSpec, it's missing the .pri files.

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Jan 17, 2017

Contributor

@onovotny Could you update the build steps for the above project? I am getting the following errors:

"D:\temp\pri-files\Zeroconf\Zeroconf\Zeroconf.csproj" (Build target) (1:2) ->
(CheckForDuplicateItems target) ->
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk
.DefaultItems.targets(123,5): error : Duplicate 'Compile' items were included. The .NET SDK includes 'Compile' items fr
om your project directory by default. You can either remove these items from your project file, or set the 'EnableDefau
ltCompileItems' property to 'false' if you want to explicitly include them in your project file. The duplicate items we
re: 'AdapterInformation.cs'; 'AsyncLock.cs'; 'Dns\Header.cs'; 'Dns\Question.cs'; 'Dns\Record.cs'; 'Dns\RecordA.cs'; 'Dn
s\RecordAAAA.cs'; 'Dns\RecordNSEC.cs'; 'Dns\RecordPTR.cs'; 'Dns\RecordReader.cs'; 'Dns\RecordSRV.cs'; 'Dns\RecordTXT.cs
'; 'Dns\RecordUnknown.cs'; 'Dns\Request.cs'; 'Dns\Response.cs'; 'Dns\RR.cs'; 'Dns\Structs.cs'; 'DomainService.cs'; 'INe
tworkInterface.cs'; 'Properties\AssemblyInfo.cs'; 'ServiceAnnouncement.cs'; 'ZeroconfRecord.cs'; 'ZeroconfResolver.Asyn
c.cs'; 'ZeroconfResolver.cs'; 'ZeroconfResolver.Observable.cs' [D:\temp\pri-files\Zeroconf\Zeroconf\Zeroconf.csproj]```
Contributor

rohit21agrawal commented Jan 17, 2017

@onovotny Could you update the build steps for the above project? I am getting the following errors:

"D:\temp\pri-files\Zeroconf\Zeroconf\Zeroconf.csproj" (Build target) (1:2) ->
(CheckForDuplicateItems target) ->
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk
.DefaultItems.targets(123,5): error : Duplicate 'Compile' items were included. The .NET SDK includes 'Compile' items fr
om your project directory by default. You can either remove these items from your project file, or set the 'EnableDefau
ltCompileItems' property to 'false' if you want to explicitly include them in your project file. The duplicate items we
re: 'AdapterInformation.cs'; 'AsyncLock.cs'; 'Dns\Header.cs'; 'Dns\Question.cs'; 'Dns\Record.cs'; 'Dns\RecordA.cs'; 'Dn
s\RecordAAAA.cs'; 'Dns\RecordNSEC.cs'; 'Dns\RecordPTR.cs'; 'Dns\RecordReader.cs'; 'Dns\RecordSRV.cs'; 'Dns\RecordTXT.cs
'; 'Dns\RecordUnknown.cs'; 'Dns\Request.cs'; 'Dns\Response.cs'; 'Dns\RR.cs'; 'Dns\Structs.cs'; 'DomainService.cs'; 'INe
tworkInterface.cs'; 'Properties\AssemblyInfo.cs'; 'ServiceAnnouncement.cs'; 'ZeroconfRecord.cs'; 'ZeroconfResolver.Asyn
c.cs'; 'ZeroconfResolver.cs'; 'ZeroconfResolver.Observable.cs' [D:\temp\pri-files\Zeroconf\Zeroconf\Zeroconf.csproj]```
@onovotny

This comment has been minimized.

Show comment
Hide comment
@onovotny

onovotny Jan 17, 2017

@rohit21agrawal I've just pushed an update to the dev branch with the updated glob.

onovotny commented Jan 17, 2017

@rohit21agrawal I've just pushed an update to the dev branch with the updated glob.

@onovotny

This comment has been minimized.

Show comment
Hide comment
@onovotny

onovotny Jan 31, 2017

Should this be in RC3 or only in RTM? I tested RC3 and I don't see the pri files in the package....

onovotny commented Jan 31, 2017

Should this be in RC3 or only in RTM? I tested RC3 and I don't see the pri files in the package....

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Jan 31, 2017

Contributor

This is in RTM

Contributor

rohit21agrawal commented Jan 31, 2017

This is in RTM

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Jan 31, 2017

Contributor

The latest CLI will have this fix though

Contributor

rohit21agrawal commented Jan 31, 2017

The latest CLI will have this fix though

@onovotny

This comment has been minimized.

Show comment
Hide comment
@onovotny

onovotny Feb 9, 2017

should this be in RC4? I just tested RC4 and still don't see the .pri file in the package.

onovotny commented Feb 9, 2017

should this be in RC4? I just tested RC4 and still don't see the .pri file in the package.

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Feb 9, 2017

Contributor

@onovotny yes this should be in RC4.

can you do a /v:diag build on your UWP project and give me the values of $(IncludeProjectPriFile), $(ProjectPriFile) and $(_TargetPathsToAssembiles) ?

Contributor

rohit21agrawal commented Feb 9, 2017

@onovotny yes this should be in RC4.

can you do a /v:diag build on your UWP project and give me the values of $(IncludeProjectPriFile), $(ProjectPriFile) and $(_TargetPathsToAssembiles) ?

@onovotny

This comment has been minimized.

Show comment
Hide comment
@onovotny

onovotny Feb 9, 2017

Will do but you should be able to repro with Zeroconf. check out the dev branch of https://github.com/onovotny/zeroconf. Then in the src\zeroconf directory, do msbuild /t:restore zeroconf.csproj then msbuild /t:pack zeroconf.csproj.

Looking at the nupkg in the bin directory, the lib\uap10.0 folder doesn't have the pri.

onovotny commented Feb 9, 2017

Will do but you should be able to repro with Zeroconf. check out the dev branch of https://github.com/onovotny/zeroconf. Then in the src\zeroconf directory, do msbuild /t:restore zeroconf.csproj then msbuild /t:pack zeroconf.csproj.

Looking at the nupkg in the bin directory, the lib\uap10.0 folder doesn't have the pri.

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Feb 9, 2017

Contributor

looking

Contributor

rohit21agrawal commented Feb 9, 2017

looking

@onovotny

This comment has been minimized.

Show comment
Hide comment
@onovotny

onovotny Feb 9, 2017

IncludeProjectPriFile is true
ProjectPriFileName = Zeroconf.pri

_TargetPathsToAssembiles doesn't exist

onovotny commented Feb 9, 2017

IncludeProjectPriFile is true
ProjectPriFileName = Zeroconf.pri

_TargetPathsToAssembiles doesn't exist

@onovotny

This comment has been minimized.

Show comment
Hide comment
@onovotny

onovotny Feb 9, 2017

Keep in mind that it's a multi-targeted project; UWP is one of the outputs

onovotny commented Feb 9, 2017

Keep in mind that it's a multi-targeted project; UWP is one of the outputs

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Feb 9, 2017

Contributor

_TargetPathsToAssemblies would exist when you call pack.
Also ProjectPriFullPath instead ProjectPriFileName

Contributor

rohit21agrawal commented Feb 9, 2017

_TargetPathsToAssemblies would exist when you call pack.
Also ProjectPriFullPath instead ProjectPriFileName

@onovotny

This comment has been minimized.

Show comment
Hide comment
@onovotny

onovotny Feb 9, 2017

can you repro on my project? I tried it again and get the same result.

onovotny commented Feb 9, 2017

can you repro on my project? I tried it again and get the same result.

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Feb 9, 2017

Contributor

yeah i am installing all the required workloads

Contributor

rohit21agrawal commented Feb 9, 2017

yeah i am installing all the required workloads

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Feb 10, 2017

Contributor

@onovotny turns out the .pri file is being included only when project has TargetFramework , and not TargetFrameworks . Figuring out why this is happening.

Contributor

rohit21agrawal commented Feb 10, 2017

@onovotny turns out the .pri file is being included only when project has TargetFramework , and not TargetFrameworks . Figuring out why this is happening.

@rohit21agrawal rohit21agrawal changed the title from Pack target misses .pri files for Windows targets to Pack target misses .pri files for Windows targets when multitargeting Feb 10, 2017

@rohit21agrawal rohit21agrawal modified the milestones: 4.0 RTM, 4.0 RC4 Feb 10, 2017

@rrelyea

This comment has been minimized.

Show comment
Hide comment
@rrelyea

rrelyea Feb 10, 2017

Contributor

We'll consider the fix when we see the code, etc... Please work on a fix.

Contributor

rrelyea commented Feb 10, 2017

We'll consider the fix when we see the code, etc... Please work on a fix.

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Feb 10, 2017

Contributor

@rrelyea i have sent out a PR for this.

Contributor

rohit21agrawal commented Feb 10, 2017

@rrelyea i have sent out a PR for this.

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Mar 2, 2017

Contributor

i have merged the fix for this bug into dev branch for 4.3 milestone, but reopening this under 4.1 milestone for visibility.

CC: @rrelyea @DoRonMotter

Contributor

rohit21agrawal commented Mar 2, 2017

i have merged the fix for this bug into dev branch for 4.3 milestone, but reopening this under 4.1 milestone for visibility.

CC: @rrelyea @DoRonMotter

@rohit21agrawal rohit21agrawal reopened this Mar 2, 2017

@onovotny

This comment has been minimized.

Show comment
Hide comment
@onovotny

onovotny Mar 2, 2017

What's it going to take to get this into 4.1? Seems like a small fix?

onovotny commented Mar 2, 2017

What's it going to take to get this into 4.1? Seems like a small fix?

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Mar 10, 2017

Contributor

checked into 4.1.0-rtm via NuGet/NuGet.Client@0d68700

Contributor

rohit21agrawal commented Mar 10, 2017

checked into 4.1.0-rtm via NuGet/NuGet.Client@0d68700

@rrelyea rrelyea closed this Mar 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment