What directory to publish Asp.NET Core application on desktop to? - deployment

I come from the desktop application world (WPF, WinForms), where the convention is to deploy your exe to \Program Files[ (x86)]\CompanyName\AppName\ directory, and store all the data in \Program Data\CompanyName\AppName\ directory.
What's the corresponding convention for deploying Asp.NET Core web services on a desktop (not a server) PC? Program Files directory doesn't seem like a good idea, because it requires admin credentials for writing, a problem you hit the moment you try to publish the app. On the other hand, while Program Data doesn't have the permission problem, it just doesn't feel right, given there is no corresponding Program Files location.
I've also seen C:\intepub\wwwroot\web-service-name used, when IIS was involved. Is that the way to go? I'm guessing it makes sense when running Asp.Net Core app in Kestrel behind IIS as reverse proxy, but what if I were to host my app inside a Windows Service instead?

There is a lot of enduser as well as enterprise apps deployed as windows services with embedded web applications (using Apache, tomcat..etc) Under Program Files, Ex: HPE server admin/config tools.
So for Kestrel APP, I would deploy bin in Program Files and write logs,DB,etc under Program Data. it will works without permission issues since dotnet binary has the needed perms.

Related

Where do I place the deployment files for asp net core application

I have a self contained asp net core web application and I dont know where in the file system I need to place the files. I will be using the Kestrel web server without a reverse proxy as it will be behind the AWS application load balancer. I will use amazon linux2 AMI
It is OK to place it anywhere as long as the hosting user has sufficient permissions to the folder. Simply create a systemd service configuration and it would work properly.
Consider placing it in /usr/share as where the applications commonly are.

Can Windows services be deployed from Visual Studio as easily as web projects?

I'm running an ASP.NET Core web service that's dead easy to deploy to IIS on a Windows Server using WebDeploy: Right-click the project in VS, choose Publish, done. The currently running site is backuped and then updated. Couldn't be easier.
However, Windows services are another matter. I'm taking over maintenance of a service that is currently updated by building the Release config, remote desktoping to the server, stopping the current service, renaming the folder the service executable resides in (for easy rollback in case something goes wrong), copying over the build output from the dev machine, renaming the copied folder to the service folder name so the service finds the executable, and starting the service.
Is there a way to publish/update Windows services that is as easy as running WebDeploy? I haven't found any. There's always the possibility of abusing WebDeploy and just replacing the Windows service head project with an ASP.NET head project running on IIS, but the service has nothing to do with the web and I have no idea whether there would be any side effects to this solution.
(I could of course just write a script that performs the copying etc., but a built-in VS deployment process as with web projects would be optimal. As for continuous integration/deployment, it is unfortunately not something we have ever done at my company.)

Deploying Sinatra app .rb

I know this is probably a stupid question. But I created a .rb file with Sinatra framework and I am not sure how to "deploy" it. When I posted the file on the server I just get a simple text file that reads back my code. It works great when I run it with Sinatra.
Thanks in advance!
It looks like your web server (Apache?) is just serving you with your Ruby script (that is a text, ASCII file) instead of running it (that is: instead of passing it through the Ruby interpreter).
Hence:
Is the Ruby interpreter installed on your server?
Is your web server configured to run Ruby scripts (files terminating with ".rb")
through the Ruby interpreter?
And, is Sinatra itself installed on your web server?
Anyway, Ruby applications (Rails, Sinatra, Padrino) are usually deployed to a server using GIT. Have a look at Heroku and Engine Yard.
Also, there are tools specifically designed to help the developer in deploying Ruby applications. Have a look at Capistrano or Vlad and/or Google for "how to deploy a sinatra application".
For Sinatra/Rails/etc, most people use a Webserver (ie Apache, Nginx, etc) AND an Application Server (Thin, Passenger, Unicorn). For a simple app these can live on the same host. The webserver manages the incoming traffic and the application server executes the ruby code and passes results to the webserver.
When you execute ruby app.rb to run your Sinatra application, you're actually loading up WEBrick which is an application server. Since your development machine is local, you can access it directly at localhost:3000 or some similar address.
Look into tutorial on setting up your webserver with Thin, it's one of the easier ones to work with. When/if you outgrow it, then look into Unicorn.

Deploy WPF ClickOnce .application File as .EXE

I've developed a WPF application. A large company is trying to make my application available to users' desktops. The traditional way to do this would be to point the users' browsers to:
http://www.MySite.com/MyApp.application
But the I.T. group at this company has configured their proxy server in such a way so as to block .application files for security reasons. They do, however, allow .exe files to pass through their proxy server and execute on client workstations. The irony of allowing .exe's from the Internet while blocking .application text files "for security reasons" isn't wasted on me but let's put that aside for a moment.
What kind of workaround would you recommend that would allow my app to launch from client desktops given that .EXEs are allowed? My first thought is to write a mini launcher app that does nothing more than download a .zip'd version of the .application file and all dependencies to a temp folder on the user's machine and then launch the .application file from there. Is there a better solution?
FWIW: Google has figured out a way to deploy their Chrome browser to Windows desktops in corporations like this one, despite the fact that ClickOnce is their deployment mechanism. If you view the source code at:
http://www.google.com/chrome/thankyou.html?&oneclickinstalled=
...you'll see they're pointing to an installer at:
/update2/installers/clickonce/GoogleInstaller_en.application.
That's a clickonce file. But somehow they've figured out a way to wrap it in an .exe in order to bypass proxy restrictions on .application files. I not familiar enough with JScript to understand what they're doing but it works. I'm trying to emulate this behavior for my own app.
This may not work for your situation. However, one possibility is to xcopy your exe and any dependencies to a folder on your webserver. Add a link in a webpage to your exe so your users can launch the app by clicking the link. In order for any of the users to be able to run the exe the first time, a caspol script needs to be run on each user machine to allow your app to run. Whenever you update the app, just xcopy the new version to the same folder on the webserver.

What is WEBDAV?

I want to use WebDAv server to share files among systems and (iPod or iPhone) in my iphone project. To use it, do I have to use an individual webserver? Or is it a built in facility?
WebDAV is a way to share files through a web server, which includes functionality for file locking and versioning.
Presumably, you would run Apache or another WebDAV-savvy web server, enabling access to a folder and its contents through the setting of relevant permissions.
This service would be run on a server somewhere — such as a Mac OS X workstation, which has Apache installed by default — and which has files that you want to present to the outside world.
Your iPhone device would connect to the WebDAV server through a WebDAV client; for example, DAV-E. The client locates and displays a list of files and folders, allowing uploads and downloads.
It typically isn't a built-in facility, but can be enabled as an extension of existing webservers, e.g mod_dav for Apache, WebDAV publishing for IIS, etc.
Short for Web-based Distributed Authoring and Versioning.
WebDav is sometimes referred to as DAV.
An IETF standard set of platform-independent extensions to HTTP
It allows users to collaboratively edit and manage files on remote Web servers.
It features XML properties on metadata, locking - which prevents authors from overwriting each other's changes - namespace manipulation and remote file management.
To know more Visit the FAQ