C#C
C#2y ago
NeRooN

My NuGet packages are not created

Hello, I'm trying to create a NuGet package and create it directly in a shared folder.

The thing is that this library has multiple target frameworks, and when i create the NuGet it doesnt create the .nupkg file in the PublishDir folder. I've tried with only 1 target framework and it works, so it looks like targeting multiple frameworks is the problem here.

This is the config of the .csproj:

  <PropertyGroup>
    <TargetFrameworks>netcoreapp31;net60</TargetFrameworks>
    <LangVersion>7.1</LangVersion>
    <VersionPrefix>1.0.0</VersionPrefix>
    <!--<VersionSuffix>rc.1</VersionSuffix>-->
    <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
  </PropertyGroup>


and the FolderProfile.pubxml:
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration>Release</Configuration>
    <Platform>Any CPU</Platform>
    <PublishDir>\\dev\NuGet</PublishDir>
    <PublishProtocol>FileSystem</PublishProtocol>
    <TargetFramework>net60</TargetFramework>
  </PropertyGroup>
</Project>


as i mentioned, if i change this line:
    <TargetFrameworks>netcoreapp31;net60</TargetFrameworks>

for this:
    <TargetFramework>net60</TargetFramework>


the nupkg file is created under \dev\NuGet

Any idea?
Was this page helpful?