1

I am not a regular developer but I have some C# programming knowledge with some basic knowledge of Winforms and ASP.NET. Over the last 2 weeks I have been trying to experiment with creating a Winform application that uses Awesomium web control and NancyFX self hosting server to build a simple desktop application.

The documentation for Awesomium and NancyFX is present on their respective sites but still seems that it requires professional/advanced developers to understand it. There are no guides or step by step demos for beginners on how to use these SDKs with C#.

My main reference has been this article - http://techny.tumblr.com/post/74609918957/arachnid-windows-gui-development-using-net-chromium

I am able to display content on the form but when i try to display MainForm.html i get a 404.

public class DefaultModule : NancyModule
{
    public DefaultModule(Form Form1)
    {
        Get["/"] = parameters => Response.AsFile("Static/MainForm.html");

        //Get["/"] = parameters =>
        //{
        //    //return "This works";

        //};
    }          
}

I have also defined the Static folder as mentioned here - How to serve static content in Nancy

Instead of copying several lines of code here I have uploaded the code and the project at http://www.filedropper.com/awetest

Community
  • 1
  • 1
Ron
  • 49
  • 1
  • 9

1 Answers1

1

You don't seem to copy the static folder to the output folder when compiling. I'm you are running the app from that output folder (as would if you just press F5 in Visual Studio). You can make Visual Studio copy on compile by right clicking the files you want to copy in solution explorer, choosing properties and set the Copy to Output Directory to Copy always. That should make the static folder appear in the output folder, so the relative paths you refer from the code are there at runtime.

Christian Horsdal
  • 4,914
  • 23
  • 24
  • Thanks! That solved the issue. I wrongly assumed that all files and folders are copied into the debug folder on compiling the solution. The HTML page is displaying as expected. I can now proceed to attempt displaying an aspx page. – Ron Aug 11 '14 at 18:36
  • I would recommend trying to display a .cshtml or .sshtml page instead of a .aspx page. – Christian Horsdal Aug 12 '14 at 08:38