Last post Nov 07, 2018 02:31 PM by haraldsh
Oct 31, 2018 12:28 PM|haraldsh|LINK
Perhaps not the best title, but it just shows I'm a bit out of place with what I'm trying to achieve.
What I want to create is an application that can be distributed as two nuget packages (library package and a config package) and be installed in any .net core mvc or web api project.
However, I need to figure out how to add configure files. Such as a .json file which is application specific, startup settings and quite possibly settings that should be added under the main method under Program. I want to have two packages since the library
functionalities will be used in application libraries and therefore it should be possible to avoid having extra files in library project.
Are there any examples or tutorials that shows how this can be achieved? At least the configuration bit?
Oct 31, 2018 04:02 PM|bruce (sqlwork.com)|LINK
Nov 02, 2018 09:59 AM|Sherry Chen|LINK
Hi haraldsh ,
I need to figure out how to add configure files. Such as a .json file which is application specific,
If you want to includ json configuration files in a nuget package,try to use <files> node in the .nuspec file. Example from here:
<!-- ... -->
<!-- Add a readme -->
<file src="readme.txt" target="" />
<!-- Add files from an arbitrary folder that's not necessarily in the project -->
<file src="..\..\SomeRoot\**\*.*" target="" />
Best Regards ,
Nov 07, 2018 02:31 PM|haraldsh|LINK
The links points to how things are done with .nuspec files.
However, with the recent changes in .Net Core and how the dotnet pack works, I want to utilize the csproj file to setup the nuget package.
So far I've ended up with
Where I'm struggeling to get the Configuration\ConfigFile.cs to be added to the target project. The config file is in the nuget package, but it's not added to the target project when installing the nuget package.