Deploying Websharper Application from Visual Studio 2012 - f#

So as a beginner to the entire Visual Studio IDE and a beginner to F# and the F# based WebSharper, I have certain issues on the system. I use the 'Ctrl+F5' to test the application. Now what do I do if I want to package the application and deploy it on another server, say apache server? Assuming the basic example here has just the .js files and HTML files, where do I find the generated web pages and/or .js files or how do I generate them.

If you created the application using the HTML Site template you’ll find the HTML bundle in the project’s bin folder. You can deploy WebSharper applications built using this template on any server you prefer. If you used one of the Web Application templates (Sitelets, ASP.NET, …) you have the choice between Windows hosting and following these instructions to host the application using Mono on a Linux box running nginx.
When it comes to Windows hosting, AppHarbor is a great choice for deploying WebSharper apps and you can use one of these two templates which both build on AppHarbor to jumpstart your project:
WebSharperMVC
WebSharperBootstrap

Related

Getting error "This command can only be run inside of a CLI project error while running through CLI"

I am working on existing angular and .Net MVC application. In Web Project, I used angular and HTML pages. I want to run this application through CLI. II try to use ng serve option but it's giving above error.
I used following steps to run. Please let me know If anything is missing
1)Open Cmd prompt and went to my web project folder in which angular and package.json exist. 2)run ng serve --open in that location
getting above mentioned error.
I hope your project is a demo, because it is incorrectly managed, your app folder should be inside src folder. For using Visual Studio to make Angular App.
Here is a video tutorial/playlist to follow.
Setting up Angular 2 in Visual Studio . Here, you will see correct architecture to keep your files/folders, and method to run your application. Although, it is not my recommendation.
1). Recommendation => Use VS Code for making Angular App, and .Net Core for making Web API. For making http calls, you will have CORS at your service. Following this architecture will keep your application well-maintained.
OR
2). Recommendation => If You want to use Visual Studio for both sides, make .Net Core Web Application, there you will find ANGULAR, make project from there, and compare its architecture with your own.
You need to go inside the Angular CLI project directory to run this command.
(Probably where your package.json file exist)

Multiple VS 2017 Projects in one Docker Container

I am using VS 2017 15.6.4 which is the latest version. I have a single solution that has three web projects in it:
Solution:
Web Project 1
Web Project 2
Web Project 3
I would like to add Docker support so that all the web projects end up in a single container running IIS with the following IIS site structure:
Root Site (Web Project 1)
Admin Virtual Application (Web Project 2)
Campaign Virtual Application (Web Project 3)
Is there a way to accomplish this in Visual Studio 2017? When I add Docker support it seems to be on a project by project basis. I can run each project in its own container with no issues. Will I be forced to do this outside of Visual Studio?
I had a similar question and found the following helpful. Make sure you have Docker CE installed on your machine, along with VS2017 with Docker support. In VS2017, when you do "Add->Docker Support", it should automatically include the docker-compose.yml file at the root of your solution.
https://learn.microsoft.com/en-us/dotnet/standard/microservices-architecture/multi-container-microservice-net-applications/multi-container-applications-docker-compose#step4_define_svcs_in_docker_compose_yml
There is also a sample application posted on github, linked below. Note that this follows .Net Core v2.1. I'm assuming you are using .net core and if so, note that v2.0 is end of life later this year so you should consider moving to v2.1
https://github.com/dotnet-architecture/eShopOnContainers
The github project above also has links to some free books talking more on docker and .net core. They helped me out a lot!

Deploying ASP.Net website in VPS (windows server 2012)

I've recently bought a VPS in which I wanna host a website. When I waana upload an ASP.Net MVC website in a normal shared hosting, I simply use the the publish option in the visual studio and the website gets automatically uploaded in the host. In the VPS which has Windows server 2012, there is a server manager which I used to create an area in the hard drive where I have to put my web file. (I put a hello world html file and it works)
My question is that, I have never manually uploaded an ASP.Net application before and I do know how exactly Visual Studio publish those ASP.Net website, so how can I manually build the website and put it in the VPS.
I used the batch build, VS made some Dlls and I don't know what to do with them .
If you call MS build from the command line in the following manner for instance:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe TestApp.csproj /p:Configuration=Release /t:Package
by specifying the target "Package" (/t:Package) you are commanding MSBUILD to package the website.
It will proceed to build and package your website into an MSDEPLOY package (specific zip file layout).
The build output from the sample build is actually very helpful and gives you clues as to where to go next, for example it tells us where it created the file:
Package "TestApp.zip" is successfully created as single file at the following location:
file:///C:/TestApp/obj/Release/Package
It also gives us a link to find out more:
To get the instructions on how to deploy the web package please visit the following link:
http://go.microsoft.com/fwlink/?LinkId=124618
Then it shows you where it created a sample .cmd file for deploying the package
Sample script for deploying this package is generated at the following location:
C:\TestApp\obj\Release\Package\TestApp.deploy.cmd
For this sample script, you can change the deploy parameters by changing the following file:
C:\TestApp\obj\Release\Package\TestApp.SetParameters.xml
Now you can customize the ".deploy.cmd" file to publish your application on your server. Edit the ".SetParameters.xml" file to setup specific parameters for your server. Login into your server, run the command file from a console that has right to publish and all should be good.

Simulating remote environment?

I'm building a .NET MVC application which will be deployed on a Windows 2003 server. The server has a folder # c:\Website\Files which needs to be written to from the application.
How do I cope with this in my development environment so that the MSI setup file, which I will compile, will work correctly when deployed?
p.s. the folder is NOT located in a subdirectory of the application project
I found another implementation. I think this might be a obsolete question.

Precompiling ASP.NET MVC on Mono with Web Deployment Project

I am trying to precompile and deploy my ASP.NET MVC application from Visual Studio 2008 to a server running Mono 2.4 using a Visual Studio 2008 Web Deployment Project. Whenever I go to the website, however, I get an error message:
This is a marker file generated by the
precompilation tool, and should not be
deleted!
Has anyone got this working? Is there a better way to precompile and deploy an MVC application from Visual Studio 2008 to Mono?
You need to make sure that when you used the aspnet_compiler command, you specified the virtual directory where the applications would reside with the -v command. For instance, if you want to build and serve a stock ASP.NET MVC application, Mvc1, from localhost/Mvc1, you would need to make sure you use the -v /Mvc1 switch:
aspnet_compiler -f -p c:\projects\Mvc1 -v /Mvc1 c:\test\output
Since this is an ASP.NET MVC application, I would also suggest making sure you explicitly configured Apache mod_mono, rather than depending on AutoHosting. I discussed why in my answer to "Mono 2.4, AutoHosting and MVC".
You can now use the Apache mod_mono configuration tool hosted on the mono website.

Resources