I'm creating a nuget package for my open source project and I've run into an issue that I'd like someone to help me with.
My project is depending on a package called RazorGenerator.Mvc. This is a great package that allows me to compile my Razor views (.cshtml) into my dll.
To enable this functionality, the RazorGenerator.Mvc package seems to consist of a powershell script that adds a file RazorGeneratorMvcStart.cs to my project's App_Start directory. This is fine.
However, since my project is depending on this package, whenever someone installs my nuget package, the same powershell script seems to be run in their project. This is because the RazorGenerator.Mvc package is installed into the user's project alongside my nuget package.
Is there a way to prevent this? I would prefer if this script only runs in my local project to embed my Razor views into my resulting .dll, and not to run in my user's projects.
In other words, my project needs to remain dependent on RazorGenerator.Mvc, but I would like to prevent destination projects to be dependent on it as well (they are already depending on my package). The RazorGenerator.Mvc package has done its job in compiling the Razor views and does not need to be installed into my users' projects.
Hope this made sense. Thanks for any response!
PrivateAssetson aPackageReference