Closed underctrl closed 4 years ago
It's been years since I've looked at this I'm afraid, but I think it's "../SomeProject2"
My answer is not related to VPP directly but I assume it's being useful for you.
On server, an Mvc project load assemblies from its bin folder. But, the server (window server) doesn't use these files all time. After application start, the files in bin folder copies to the shadow folder. But server watches the bin folder to reflects changes. Unfortunately, the server doesn't watch another folders. To do that, you can set up a FileSystemWatcher. While running this class's instance, the file changes in the folder that you gave being watched. So, after you build project2, all changes will be reflected after a few seconds...
Here's the critical line: https://github.com/mcintyre321/EmbeddedResourceVirtualPathProvider/blob/2f38cf2bc0e72052e03b4f36483d4ff45809fc45/EmbeddedResourceVirtualPathProvider/EmbeddedResource.cs#L51
The path is relative from "/Project1", so "../Project2"
@bafsar Thanks, I didn't know about the FileSystemWatcher
-- That's good to know...
@mcintyre321 Thank you, I finally got this working -- I just needed to know that the path is relative from/to the project folders, not the bin folders...
I have two projects:
/Project1 is a C# MVC web app
/Project2 is just a collection of helper classes, with some Views and JavaScript files
(Note that I actually have a few web projects that will share the files from Project2 -- I'm just trying to keep this example simple to grok...)
I've setup EmbeddedResourceVirtualPathProvider in Project1 like this, and it works (my site finds the files embedded within the Project2 DLL...)
My problem is that if I make changes to anything in Project2 and build only that project, the changes are not picked-up by Project1 auto-magically like I thought they were supposed to be. It also works this way no matter what path string I give -- and I've tried several, like
@"..\..\Project2\bin\Debug\Project2.dll"
,C:\Project2\bin\Debug
, and even a path to a folder that doesn't exist -- but it appears to always use the DLL from Project1's bin folder (I assume, because it has to be getting it from somewhere...)How can I set this up so that I don't have to rebuild and rerun my website everytime I make changes to files in Project2? Thanks!