question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet pack doesn't include xmlserializer assembly

See original GitHub issue

When 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:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rohit21agrawalcommented, May 1, 2018

@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.

0reactions
livarcocccommented, May 1, 2018

This issue was moved to NuGet/Home#6890

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found