I am using the new MSBuild 15, distributed with VS2017 RC, to compile and package a multi-targeted project.
Recovery: msbuild /t:restore mysolution.sln working correctly.
Building: msbuild /p:Configuration=Release mylibrary.csproj works correctly and generates:
+ bin/Release + netstandard1.4 - mylibrary.dll + net452 - mylibrary.dll
But when I pack: msbuild /t:pack /p:Configuration=Release /p:IncludeSymbols=true mylibrary.csproj structure doesnβt work well with the previous assembly, looking like:
+ bin/Release + netstandard1.4 - mylibrary.pdb + net452 - mylibrary.pdb - mylibrary.dll
Warnings from the /t:pack command show me that this should happen, but donβt know how to solve it:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(73,5): warning : Issue found with package 'MyLibrary'. [D:\XXX\YYY\src\MyLibrary\MyLibrary.csproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(73,5): warning : Issue: Assembly not inside a framework folder. D:\XXX\YYY\src\MyLibrary\MyLibrary.csproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(73,5): warning : Description: The assembly 'lib\MyLibrary.dll' is placed directly under 'lib' folder. It is recommended that assemblies be placed inside a framework-specific folder. C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(73,5): warning : Solution: Move it into a framework-specific folder. If this assembly is targeted for multiple frameworks, ignore this warning.
Notes:
I do not use the *.nuspec file. Only new *.csproj files *.csproj ( https://docs.nuget.org/ndocs/schema/msbuild-targets#pack-target )
Here's what the relevant content in the file looks like:
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <OutputType>library</OutputType> <TargetFrameworks>netstandard1.4;net452</TargetFrameworks> <AssemblyName>MyLibrary</AssemblyName> <Authors>XXX</Authors> <Description>YYY</Description> <PackageId>MyLibrary</PackageId> <PackageVersion>1.2.3</PackageVersion> </PropertyGroup> </Project>
source share