Precompiling ASP.NET MVC on Mono with Web Deployment Project - asp.net-mvc

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.

Related

Can one install a vNext (C# 6) console app as a Windows service

In previous versions of .Net, there were some different methods of creating a project that could run as a console app or be installed as a service.
Things like TopShelf or other approaches like: .NET console application as Windows service
This is a nice convenience for development and later deployment. I put together a vNext console app using a similar approach to the accepted answer here: .NET console application as Windows service.
The issue is that vNext runs things in a different way. If you create output, it no longer gives you an exe to install. Instead you get a nuget package and a .cmd file that will tell dnx to host your application. The command file looks like:
dnx --appbase "$(dirname $0)" Microsoft.Framework.ApplicationHost My.vNext.Service $#
So my question is: Is there a way to install this thing as a Windows service given the new console application approach?

Deploying Websharper Application from Visual Studio 2012

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

How do i run a ServiceStack console project as a Windows Service?

I have create a ServiceStack console application that works great, but of course, I have to leave it running after triggering it from a command prompt. I want to run this as a Windows Service.
I'm reviewing this wiki page which states that you can run SS as a Windows Service.
https://github.com/ServiceStack/ServiceStack/wiki/Self-hosting
I was not totally clear on how to do this. This StarterTemplate is referenced from 2 years ago. Do I clone this project and then copy my code into it?
https://github.com/ServiceStack/ServiceStack.Examples/tree/master/src/StarterTemplates/WinServiceAppHost
The easiest way is to create a ServiceStack Windows Service Empty project in ServiceStackVS VS.NET Extension.
Otherwise you can clone the WinService project, and create a new Windows Service project from Visual Studio and copy the approach in Program.cs.
A more recent ServiceStack Windows Service project is the Razor Rockstars website running in a Windows Service Host, the template of which was based on the ServiceStack.Examples Starter template.
I use topshelf to run a servicestack console app as a windows service. It works really well for me. https://github.com/Topshelf/Topshelf

How best to install MVC 3 on a server?

Now that MVC 3 Tools Update has been released, that's all I see on the Web Platform Installer -- I no longer see MVC 3? Is this because the Tools Update is essentially MVC 3 PLUS enhancements to the development environment? Presumably, none of these additions are needed on a server so I thought that MVC 3 would still be offered for server installs.
So can/should I install the MVC 3 "Tools Update" from the Web Platform installer on a server?
I know this doesn't help you Decker, but it may help others:
The easiest way to get MVC on the server is by using the "Add Deployable Dependancies..." menu:
Also useful for deploying SQL CE.
You can use the installer from WebPI on the server just fine. It will detect if you don't have Visual Studio installed and will only install the runtime.
You could also try unzipping the installer file and only copying the runtime MSIs but I think that's overkill.
You could also use Web Platform Installer from the command line:
webpicmd /install /Products:MVC3Runtime /log:webpi.log /accepteula /SuppressReboot
If your servers don't have internet access, you can use the offline flag from a machine which does have access to download a copy of the required install files.
So your flow would be as follows:
Prepare Cached Version of Installers
webpicmd /Offline /Products:MVC3Runtime /log:webpi.log /Path:"%~dp0wbpiCache"
Install from cache (copy folder structure to target machine)
webpicmd /install /Products:MVC3Runtime /log:webpi.log /accepteula /SuppressReboot /XML:"%~dp0wbpiCache"
You don't need to install MVC3 on a server.
Just copy the MVC DLLs along with your projects.

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.

Resources