So I have set up which looks something like following:
Source.sln have three project A.csproj, B.csproj and utils.csproj. Both A and B use utils.csproj but I have converted utils.csproj to a nuget package so now A and B both consume utils nuget package instead of a project reference.
next thing I do is make nuget packakage from both bot A and B. So now I have three nuget packages
1.A.Nuget(uses utils.nuget) 2.B.nuget(uses utils.nuget) 3. Utils.nuget
Now, I have another consumer.csproj which uses all three as nuget references.
The problem here is that Both A.csproj and B.csproj had inputA.json and inputB.json files which are required at the runtime. They do not change at all so it is better that they are packaged with nuget package
My question is that what is the cleanest way to paclage them? I thought of couple of options but am not satisfied by either of them:
pack them in utils.nuget's /content folder by specifying that in .csproj file. But the problem here is that the code reading them from nuget needs to reference thse files from ../contents/inputA.json which is not the case in Development environment. They simply reside in A.csproj/ folder and can be referenced as "input.json". So the same code which works on Visual studio(referencing this file as
input.json) would break when consumer.csproj references A.nuget and utils.nugethave Consumer supply all these files. This could be an option but I want to avoid it if possible.
Somehow figure out a way to copy this files into /lib folder of utils.nuget instead of /contents. I am currently trying to achieve this using .nuspec file. but not sure if this is the cleanest solution
Can I do something better about this situation?