Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

How to include config file in nuget package? [duplicate]

$
0
0

I have a class library package: ClassLib.Main which is a simple extension method for DI that will register something in the container.

ClassLib.Main has a dependency on another class library -> ClassLib.Config which has some classes and an sharedsettings.json (which is being added and read in ClassLib.Main extension method).

However when I install these packages in another project (asp net core web api), it fails with error that there are no such file as sharedsettings.json and it is required.

Here's the .csproj of ClassLib.Config:

<Project Sdk="Microsoft.NET.Sdk"><PropertyGroup><TargetFramework>net5.0</TargetFramework><RootNamespace>ClassLib.Config</RootNamespace><GeneratePackageOnBuild>true</GeneratePackageOnBuild><Version Condition=" '$(BUILD_BUILDNUMBER)' == ''">1.2.3.4-Dev</Version><Version Condition=" '$(BUILD_BUILDNUMBER)' != ''">$(BUILD_BUILDNUMBER)</Version></PropertyGroup><ItemGroup><None Update="sharedsettings.json"><CopyToOutputDirectory>Always</CopyToOutputDirectory></None></ItemGroup></Project>

What am I doing wrong?


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>