-
Notifications
You must be signed in to change notification settings - Fork 258
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
dotnet pack doesn't include xmlserializer assembly #6890
Comments
@rohit21agrawal can you take a first look here and let us know if the SDK is missing passing something down to pack? |
From @Styxxy on May 1, 2018 17:40 I created for now nuspec files, though it isn't ideal. Sample nuspec: <package>
<metadata>
<!-- include all of necessary tags -->
<references>
<reference file="myproject.dll" />
</references>
</metadata>
<files>
<file src="bin\$config$\net47\myproject.dll" target="lib\net47" />
<file src="bin\$config$\net47\myproject.XmlSerializers.dll" target="lib\net47" />
</files>
</package> (Typed on my phone.) Initially I found a workaround by adding a custom target before the _GetProjectFiles target and adding the XmlSerializers assembly, but I encountered the problem when installing the package in a legacy project, that the XmlSerializers asembly is also added as a reference (default nuget adds all DLL's in the package as a reference, except *.resources.dll files). |
From @Styxxy on May 1, 2018 17:50 Doesn't matter whether using ("old") way or new way (using nuget package). <!-- "old" way -->
<PropertyGroup>
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
<SGenUseProxyTypes>false</SGenUseProxyTypes>
</PropertyGroup>
<!-- "new" way (see: https://docs.microsoft.com/en-us/dotnet/core/additional-tools/xml-serializer-generator ) -->
<ItemGroup>
<PackageReference Include="Microsoft.XmlSerializer.Generator" Version="1.0.0" />
<DotNetCliToolReference Include="Microsoft.XmlSerializer.Generator" Version="1.0.0" />
</ItemGroup> |
From @rohit21agrawal on May 1, 2018 18:15 This is currently not supported, we will consider this feature ask for a future release. @livarcocc please feel free to move this issue to nuget. |
From @Styxxy on May 1, 2018 18:39 @rohit21agrawal <PropertyGroup>
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);GetMyPackageFiles</TargetsForTfmSpecificBuildOutput>
</PropertyGroup>
<Target Name="GetMyPackageFiles">
<ItemGroup>
<BuildOutputInPackage Include="$(OutputPath)$(AssemblyName).XmlSerializers.dll" />
</ItemGroup>
</Target> |
From @rohit21agrawal on May 1, 2018 18:43 @Styxxy that's correct, the issue is being tracked here: #6858 |
@Styxxy have you considered using contentFiles for XmlSerializer assemblies, instead of adding them to the lib folder of the package? |
From @Styxxy on May 1, 2018 13:10
When forcing assembly to generate XmlSerializer assembly,when packing the project, this XmlSerializer assembly is not included in the nupkg.
Project file:
command
dotnet pack myproject.csproj
generates following nuspec (in the obj folder):I would expect the XmlSerializer assembly to be included as well.
Copied from original issue: dotnet/sdk#2202
The text was updated successfully, but these errors were encountered: