mcintyre321 / EmbeddedResourceVirtualPathProvider

A custom VirtualPathProvider for IIS - load views and assets from Embedded Resources in referenced assemblies
http://www.adverseconditionals.com/2011/07/portable-aspnet-code-using.html
MIT License
63 stars 42 forks source link

Split the package onto two ones: core and bootstrapper #35

Closed evil-shrike closed 7 years ago

evil-shrike commented 7 years ago

Hi.

I want to use the lib as a dependency in my lib but I already have other startup code in that lib (registered callback via WebActivator) so additional App_Start script is unneeded. Moreover EmbeddedResourceVirtualPathProvider brings another dependency into app project (WebActivatorEx) which is also unneeded. What I'd suggest is to split the package onto two ones: the first one - "core" - is implementation (lib) without any dependencies and content scripts and and second one - "bootstrap" - is a package with dependency on "core" package, WebActivatorEx and content scripts.

What do you think?

mcintyre321 commented 7 years ago

Hi. I'm thinking about this. I don't really want to add a second package if we can avoid it, so lets go a bit deeper...

  1. You already have startup code - surely you can just delete the included cs file once it's added? It only happens when you install.
  2. You say WebActivatorEx is unneeded. Is there a better way of registering the VPP?
evil-shrike commented 7 years ago

You already have startup code - surely you can just delete the included cs file once it's added? It only happens when you install

Yeah, but it's a library (package) which is installed by other people in their apps, so they will have to do additional thing.

App
 -> Lib1 (with bootstrap code), depends on VPP
   -> VPP , depends on WebActivator + installs a content script

As I understand NuGet will install VPP into the app as transitive dependency (honestly I didn't verify that NuGet installs content files in such a case, but it should).

You say WebActivatorEx is unneeded. Is there a better way of registering the VPP?

In general I don't think there is another good way, but I just have my own WebActivator (forked) which do the same. My lib already has bootstrap logic with registering different stuff, so I was going to add just registering VPP as well in it. But I'm afraid that people who installs the lib won't notice additional script in App_Start and leave it (or do notice but don't touch it). So they'll have two registrations of VPP which is not good I believe. It's kind of dilemma what to do: keep my own registration and tell/doc that "you need to delete additional file" or just let them do registration on their own.

mcintyre321 commented 7 years ago

See https://github.com/mcintyre321/EmbeddedResourceVirtualPathProvider/issues/38