One option is that instead of adding 800 content files, you can embed them as resources in your shared library.
Then use something like EmbeddedResourceVirtualPathProvider
https://github.com/mcintyre321/EmbeddedResourceVirtualPathProvider to serve them up.
That way NuGet is simply replacing the .dll instead of 800 individual files.
There are plenty of articles online about how to use VirtualPathProvider
.
EDIT: Questions about performance
The solution seems relatively simple, so I would just try it and see if the performance is acceptable. The nice thing is that you don't have to do anything special with paths in your web app.
Here are the steps you need to do:
- In your resource library, set the content files to embedded resource. You can do that quickly by opening up the .csproj file in a text editor and replacing
<Content
with<EmbeddedResource
. - Add a reference to your resource library to your web app.
- Add the
EmbeddedResourceVirtualPathProvider
NuGet package to your web app - Register the virtual path provider. Here's an example to register using
AppInitialize()
stored in theApp_Code
folder.
namespace TestWebProject.App_Code
{
public class RegisterVirtualPathProvider
{
public static void AppInitialize()
{
HostingEnvironment.RegisterVirtualPathProvider(new EmbeddedResourceVirtualPathProvider.Vpp()
{
{typeof (Marker).Assembly, @"..\TestResourceLibrary"},
});
}
}
}