3

I have cshtml files in a shared library project, that is then referenced by the main website project.

A VirtualPathProvider is registered on startup to make it look like the views from the shared library actually exist in the main website.

The problem is breakpoints no longer work, as visual studio looks at the main website's .pdb file for the debug symbols but of course the razor files aren't really there.

Has anyone else had any luck with virtual paths and breakpoints in an MVC project? I assume putting razor views in a shared library must be a common thing and people must still be able to debug the files ok?

LynchDev
  • 793
  • 1
  • 12
  • 27
  • Are the .pdb files for your referenced project output into the bin directory after compiling or just the ones from the main web project? – puddinman13 Dec 10 '14 at 21:55
  • @NathanRenico both pdb files are in the main websites bin folder – LynchDev Dec 10 '14 at 22:12
  • @LynchDeve - Are your razor files being output from your referenced library? You may set your referenced library cshtml files' 'Copy to output directory' property to 'Copy Always' and see if that helps. – puddinman13 Dec 11 '14 at 15:56
  • Also @LynchDeve I found this article. It doesn't provide much of a solution, which isn't comforting, but it may be relevant to helping you. http://stackoverflow.com/questions/10633329/cannot-debug-embeddedresource-views-loaded-via-custom-virtualpathprovider – puddinman13 Dec 11 '14 at 16:27

0 Answers0