This repo is a demo of how to combine DotVVM with existing Nancy FX application.
-
Install the
DotVVM.OwinNuGet package. -
Install the
Microsoft.Owin.Host.SystemWebpackage if you already don't have it in your project. -
Add the OWIN Startup class if it is not present.
-
Call
app.UseDotVVM...to register DotVVM middleware in OWIN pipeline. DotVVM must be registered before Nancy. Othwerwise you would get 404 error page for DotVVM routes. -
Unload the project, edit the
.csprojfile and add the DotVVM Project guid (94EE71E2-EE2A-480B-8704-AF46D2E58D94) as a first one in the<ProjectTypeGuids>element.
This is only needed to get full editing experience in Visual Studio. If you don't have the DotVVM for Visual Studio installed, do not add this GUID otherwise you won't be able to load the project.
It should look like this:
```
<ProjectTypeGuids>{94EE71E2-EE2A-480B-8704-AF46D2E58D94};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
```
-
Make sure you have told the IIS to run all managed modules for all HTTP requests in the
web.config:<system.webServer> <modules runAllManagedModulesForAllRequests="true" /> <validation validateIntegratedModeConfiguration="false" /> </system.webServer> -
Create your DotvvmStartup file and register your DotVVM routes. Any request that doesn't match any DotVVM route, will be passed to the ASP.NET Web Forms handlers.
For more information about DotVVM, visit the DotVVM website.