After you create a new DotVVM project, you will see several files in your project:
Views/Default.dothtml- an example page.
ViewModels/DefaultViewModel.cs- an example viewmodel.
Startup.cs- startup class which configures services and registers DotVVM and static files middlewares.
DotvvmStartup.cs- a DotVVM configuration class (see the Configuration chapter).
Program.cs(.NET Core only) - the entry-point of your app (.NET Core projects only).
web.config(.NET Framework only) - a configuration file for ASP.NET and IIS. In ASP.NET Core projects, this file is optional, and is used only when you run the application inside IIS.
|.NET Core Project||.NET Framework Project|
Default convention for views and viewmodels
Many people prefer to separate views and viewmodels in the
ViewModels folders. Also, there is a naming convention, that the file
Default.dothtml corresponds to the
If you install the DotVVM for Visual Studio, it will respect that convention, so if you choose to add a new view in the
Views folder, it will place the viewmodel in the
ViewModels folder by default.
In Visual Studio, you can use the F7 key to navigate from your view to your viewmodel, and Shift-F7 to get back to your view.
Some people prefer to create the
You can use any convention that suits your needs, e.g. place views together with viewmodels in the same folder.