WebSharper issue on startup

So, I looked at developing RIA or MVC applications using F #, and I saw that there are two options:

  • FunScript
  • Websharper

I have a version of Visual Studio 2012, and this is a student version. So I just followed the link here

Now, following the instructions, I can’t get the test page. Therefore, I will need several directions / help. So this is what happens:

  • After creating Web application sites using a new project, I get an error message on the Site.fs. page It gives the same "module or namespace". So I try to use Manage NuGet References to download links for WebSharper and remove this error. Now I have already installed WebSharper on my computer. There should not be an easy way to link WebSharper libraries. If so, how can I do this? What am I doing wrong here.

  • After solving the problem, I follow the startup code to the last line on this page, I get an error in this code example:

let HomePage = Template "HomePage" <| fun ctx -> [ Div [Text "HOME"] Links ctx Div [new Controls.HelloControl()] ]

Essentially, the page does not like the addition of the new Div [ new Controls.HelloControl()] , and therefore it gives an error message.

I am new to Microsoft technologies and even Visual Studio IDE. I'm used to Eclipse and figuring out how it works has never been a problem. But I absolutely do not know how to do this.

At the end of this question, I also have a query about where I can find updated documentation on a decent presentation for both FunScript and WebSharper.

+4
source share
1 answer

For the original problem, the problem is related to the sample on the website - somehow the gap is missing, the code should be:

 let HomePage = Template "HomePage" <| fun ctx -> [ Div [Text "HOME"] Links ctx Div [new Controls.HelloControl()] ] 

Now for "The project with the output type of the class library cannot be started directly":

The solution consists of two projects: the C # web project, which hosts the web application, and the F # library project, which contains the actual code. All you have to do is right-click on the C # project in the solution explorer and select "Install as Startup Project". Thus, when you press "F5", instead of trying to start the F # library project, it will start the web project.

+5
source

Source: https://habr.com/ru/post/1491761/


All Articles