Packaging a C# MVC4 Web app as a standalone desktop app - c#

I'm wondering if it's possible to somehow package an ASP MVC4 web application (that would normally run on an IIS server+SQLLite) as a standalone desktop application?
As a result, I could distribute a single executable to be run on a desktop computer that displays the URL to which the user would then navigate using her local browser.
I read about Hostable Web Core but for some reason it seems to be tied to IIS7 which I do not want to. Anything IIS8+ or even simply .NET 4.X based is required.

Related

IIS Application Initialization doesn't start my C# .net 6.0 application

I want my C# .net 6.0 application to auto start after server restart or after application pool recycle. I am using clean architecture and react as a frontend. I have published my application on ISS, enabled auto-start, but application doesn't load without opening it's site on a web browser.
I have published my .net 6.0 application on production environment, which consist of:
Windows Server 2016 Datacenter
IIS version 10.0.14393.0. (I have installed Application Initialization feature).
On Appliction Pool of my app i have:
apppool settings
On Site of my app i have:
appsite settings
Problem is: I can't start or auto-start my app without opening its url on web browser. Without opening browser I can't even load my Program class with Main method. I want my app to load with IIS after shutdown or after recycle automatically without needing me to open it's site on browser. Maybe IIS could open my app site automatically. Inside my app in Startup I have some quartz jobs, that will load for now only after I opened my app site in browser. Without opening my app in browser Startup doesn't even load.
I tried Any way to start IIS App (Website) automatically?
but adding InProcess haven't worked.
I tried asp.net application does not auto-start
but System.Web.Hosting.IProcessHostPreloadClient is not available in .net 6.0. Also var client = new WebClient() is obsolete and doesn't work
I have similar problem like described in comment
How to properly autostart an asp.net application in IIS10
I want my app to auto start while being on IIS. Maybe IIS could open ap site? Maybe in launchsettings.json there is an option, to load app without opening browser?
Thank you for your help in advance

How to Publish ASP.NET Web Application (.Net Framework) with Visual Studio to FTP Server?

I am trying to publish an ASP.NET Web Application (.Net Framework) to a subdomain on my webhotel. The problem is that when the site has uploaded and I visit the page, the site is not displayed, only the code in the index.cshtml file is shown in the browser. The site consists of Razor Pages.
I have checked the root directory for the subdomain at my webhotel and noticed that there are no .dll files which I was expecting there would be. What might the problem be and how can I solve this?
I have been informed by the support from the Webhotel Host that it is not possible to publish a Web Application to an ordinary FTP server. Instead I have found that Google Cloud Platform or equivalent, is needed to host a Web Application. The directory needs to be specifically prepared for a Web Application.

Adding an existing vue js app to my existing .net core project?

I've developed a web api (C# .Net core), and (separately, in an entirely different directory/project) I have a client app (vue.js). I should've possibly had this in the same solution to start with but I don't.
I am running the web api in azure, it works fine. And I can run my vue js app anywhere and it can call the web api, also fine.
Question
How can I deploy my vue.js app to the same app service as my web api. They were developed separately since I intend to pass the vue.js app into phonegap shortly and treat it as a separate piece of work, but for the purposes of the web and not mobile, I need both vue.js and .net core to run on the same domain/app service and don't really want to integrate them.
What I've Tried
I have ran 'npm run build' on my vue app and have the dist folder, I've tried adding that to the root of the .net core project before publishing but I can't seem to hit the page when I navigate to the azure address.
A brute force way is to FTP the contents of your Vue app dist folder to the wwwroot folder in your Azure Web App.

Publishing a c# console application on IIS Server

Is it possible to deploy a console c# application on IIS Server.
I have one .exe file running on a machine which takes data from named pipe and my c# application takes this data from the pipe and send it to the web application running using TCP sockets, I want to know if i can deploy my C# console application on the webserver?
I am new to ASP.net and C#.
You can host an exe file on IIS server, but it is not a common practice to deploy C# console applications,
In this way you don't know if the client machine has proper .NET Framework installed. So the console application may not even launch.
The web browser can simply block the download.
Even if the exe file is downloaded, unless the user launches it locally, it won't run automatically.
Recommended approach by Microsoft is to deploy the client side application using ClickOnce,
http://msdn.microsoft.com/en-us/library/t71a733d%28v=vs.80%29.aspx
You can then host the ClickOnce installer on IIS side. For example, Microsoft CodePlex uses this kind of deployment for its open source projects,
http://codeplex.codeplex.com/wikipage?title=ClickOnce
No, IIS can be used to host only web sites or web applications. You can't host console applications in IIS.

How to deploy asp.net web application multiple times on the same server?

I have a ASP.NET 3.5 web application and I would like to allow users to install this web application multiple times on the same server.
Each web app will work with it's own database:
Server1
--------
WebApp1 - database1
WebApp2 - database2
WebApp3 - database3
Firstly I tried to use web-deployment-project, but it allows me to install my web application only once.
How I should implement deployment of web app multiple times on the same server? Should I develop my own winforms application?
Yes. I think that will be the best way to do it and by writting your custom app you'll be able to meet your specific demands.
You should make a winform application that emulates the process being done by web deployment project (like copying files to the file system, creating new application \ virtual directory on the select website, etc.).
You probably need to do this:
Create a virtual directory in IIS for
each of your databases
Be sure to set the config files for
each web application to the correct
database
When you deploy, copy your files to each directory minus your config files
You could write a small application or batch file to do it.
the best is to use Web Deploy 3.0
Web Deploy (msdeploy) simplifies deployment of Web applications and Web sites to IIS servers. Administrators can use Web Deploy to synchronize IIS servers or to migrate to newer versions of IIS. Web Deploy Tool also enables administrators and delegated users to use IIS Manager to deploy ASP.NET and PHP applications to an IIS server.

Categories