dotnet pack doesn't include xmlserializer assembly
See original GitHub issueWhen forcing assembly to generate XmlSerializer assembly,when packing the project, this XmlSerializer assembly is not included in the nupkg.
Project file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net47</TargetFramework>
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
<SGenUseProxyTypes>false</SGenUseProxyTypes>
</PropertyGroup>
</Project>
command dotnet pack myproject.csproj
generates following nuspec (in the obj folder):
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>myproject</id>
<version>1.0.0</version>
<authors>myproject</authors>
<owners>myproject</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Package Description</description>
<dependencies>
<group targetFramework=".NETFramework4.7" />
</dependencies>
</metadata>
<files>
<file src="c:\users\styxxy\Source\Repos\myproject\myproject\bin\Debug\net47\myproject.dll" target="lib\net47\myproject.dll" />
</files>
</package>
I would expect the XmlSerializer assembly to be included as well.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
dotnet pack doesn't include xmlserializer assembly #6890
When forcing assembly to generate XmlSerializer assembly,when packing the project, this XmlSerializer assembly is not included in the nupkg.
Read more >.net - XmlSerializer exception: You must add a reference to ...
The fix was actually remarkably simple: I added a Nuget reference to Microsoft.XmlSerializer.Generator and it suddenly worked. This package is ...
Read more >Dotnet pack - include referenced projects
Shows how to workaround the current limitations of dotnet pack when referencing other projects.
Read more >Create a NuGet package with the dotnet CLI
In this article. Set properties; Run the pack command; Next steps. NuGet packages contain code that developers can reuse in their projects.
Read more >PackageReference in project files - NuGet
In this article ... Package references, using <PackageReference> MSBuild items, specify NuGet package dependencies directly within project files, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Styxxy that’s correct, the issue is being tracked here: https://github.com/NuGet/Home/issues/6858 But i hope the workaround is better than having to manually manage a nuspec.
This issue was moved to NuGet/Home#6890