I started learning C # in Mono (Ubuntu) and Nancy , which is a web framework for C #. I use βsuper simple viewβ rendering and I canβt make the code to render the .sshtml file, it just displays as a plan text file. Ultimately, I want to use a layout file ( layout.sshtml ), and each view will replace a part of the layout file.
I have a hunch that perhaps the folder structure is invalid and, for example, login.sshtml does not find layout.sshtml . But I changed the .csproj file to copy the Views folders:
<Target Name="AfterBuild" Condition=" '$(Configuration)' == 'Debug' "> <Exec Command="cp -a Views $(OutDir)" /> <Exec Command="cp -a -u Database/db.sqlite $(OutDir)" /> </Target>
I'm just confused why it doesn't display the view. Any help would be appreciated.
This is a link to my repository.
This is the folder structure of my project:
βββ bin β βββ Debug β βββ csharp-practice.exe β βββ csharp-practice.exe.mdb β βββ db.sqlite β βββ Nancy.dll β βββ Nancy.Hosting.Self.dll β βββ nancy-simple-app.exe β βββ nancy-simple-app.exe.mdb β βββ Views β βββ index.sshtml β βββ layout.sshtml β βββ login.sshtml β βββ register.sshtml βββ Database β βββ DataBaseManager.cs β βββ db.sqlite βββ LICENSE βββ nancy-simple-app.csproj βββ nancy-simple-app.sln βββ nancy-simple-app.userprefs βββ obj β βββ x86 β βββ Debug β βββ csharp-practice.csproj.FilesWrittenAbsolute.txt β βββ csharp-practice.exe β βββ csharp-practice.exe.mdb β βββ nancy-simple-app.csproj.FilesWrittenAbsolute.txt β βββ nancy-simple-app.exe β βββ nancy-simple-app.exe.mdb βββ packages β βββ Nancy.1.4.3 β β βββ lib β β β βββ net40 β β β βββ Nancy.dll β β β βββ Nancy.xml β β βββ Nancy.1.4.3.nupkg β βββ Nancy.Hosting.Self.1.4.1 β β βββ lib β β β βββ net40 β β β βββ Nancy.Hosting.Self.dll β β β βββ Nancy.Hosting.Self.xml β β βββ Nancy.Hosting.Self.1.4.1.nupkg β βββ repositories.config βββ packages.config βββ Program.cs βββ Properties β βββ AssemblyInfo.cs βββ ViewModels β βββ UserModel.cs βββ Views βββ index.sshtml βββ layout.sshtml βββ login.sshtml βββ register.sshtml
Screenshot:

c # mono nancy
Node.JS
source share