Asp.Net core website update without server restart - asp.net

i have successfully upload my Asp.net core 1.01 website to Ubuntu 14.04 Vultr VPS with Nginix.
The problem is that whenever i change in my code on local development machine and upload published folder dll to server, its required to restart the application or server to view updated contents.
is someone help me to that without application or server restart. so i can just upload updated dlls via FTP and its show updated contents.
thanks

Use dotnet-watch
dotnet watch is a tool that runs a dotnet command when source files change. For example, a file change can trigger compilation, tests, or deployment.

Related

Error code 550 when publishing .NET Core 3.1 app through FTP

I have a .NET Core 3.1 app (api) that i'm publishing online and I'm using the publish method FTP in Visual Studio.
It works perfectly but when I try to publish again after coding, I always get these errors:
Publishing folder /...
Unable to add 'AutoMapper.dll' to the Web site. The process cannot access the file because it is being used by another process (550).
Unable to add 'projectname.API.dll' to the Web site. The process cannot access the file because it is being used by another process (550).
Unable to add 'projectname.Domain.dll' to the Web site. The process cannot access the file because it is being used by another process (550).
...
This goes on for quite some time on all the dll's in my project. The only way I can publish after working, is full resetting my PC, remove all bin and obj folders in my projects that have to get published, open VS and publish before doing anything else.
I suspect this has to do with VS still using the dll's somewhere/somehow while i'm trying to publish.
I have tried locating processes in task manager but haven't seen anything unusual/problematic that could cause this.
Any help regarding this would be greatly appreciated, because I like to update my API for every route I write to test on the deployed version aswell, but it's quite the hassle this way...
Thanks!
I don't think it's your pc. Error 550 is an FTP error. What I think is happening here is that when you publish your website via FTP and open your website in your browser what you actually do is run your application on your server.
When your application is running you can not modify the DLLs that are in use.
So why restarting your pc will fix the problem? It is because these hosting providers have a configuration that if no one requests a website for a while then kill the application. it is because of saving memory and cpu.
So when you restart your pc and delete bin and obj folders and rebuild your project that takes time and because in the meantime there is no request sent to your website your application is killed and now you can update your website with FTP again.
To test this scenario simply close your browsers and do not open your website for a while like half an hour and then try to update your website via FTP.
Or you can restart your PC and delete bin and obj folders but before pushing your files with FTP open your site in a browser. This must run your application and cause the 550 error again.

ASP.NET MVC project to push to a remote server

I have a ASP.NET MVC project locally, but want to push to a remote server so that others can use that website. I have login access to the remote server.
Is this what i need to do?
1) add a folder to IIS in the remote server
2) copy my files to the folder on remote server. If so, which files should i copy?
If you're using Visual Studio (not code) then right click on the project and select publish, then select the options to publish to a local folder. Copy all files in your published folder to your server.
If you're using ASP.NET Core then you can also navigate to the project folder and use the following command
dotnet publish -c Release -o PUBLISH_PATH_HERE
You will need to ensure that the server has your version of .NET runtime installed.
Create a release publish profile, publish, grab the files from the directory it published to. This is the simplest way. You can automate this process if you have many releases. For example publishing directly to the server or checking code into a source control of some kind and having it publish to the server.

How to setup Visual Studio project FTP to a remote IIS Server?

I have an ASP.Net project that I've been working on my local machine and I've successfully uploaded my application files from my local machine to the remote IIS server. My issue occurs when I make changes to my code through the IIS remote server, sometimes the changes that I have made do not appear or work. The way I fixed the problem was upload the updated project into the IIS server.
I've read a bunch of articles online and some people are mentioning the IIS cache or temp file that must be cleared.
Is there a way for me to establish an FTP connection from my local machine to the remote IIS server so that when I push changes it would automatically update the code?
You can publish your website by using visual studio publish tool. Which will automatically deploy code to your FTP location on publish. You just need to configure your FTP remote server. Right click your website project and click publish
Then select IIS,FTP from side nav and click publish
Then select FTP from Publish method drop down and start configuring your application and after that click on Validate Connection to test if it had connected to FTP properly and click next and complete configuration and your code will be deployed to that FTP remote server

How to setup PHP Server for Flex app

I am creating a Flex project on my Windows machine but it will deploy on my Linux machine.
For application server type I selected PHP
I click next to go to the next screen.
I am then asked for Web root. I put in /var/www which is the web root of the linux server where the application will be.
I get an error telling me:
The selected web root folder does not exist.
Of course it does not exist on my windows machine, its on my linux machine. It will not let me click finish.
What do I do? do I have to author my Flex app on the same machine that it will be deployed? I hope not since I do not have a Linux version of Flash Builder.
edit:
By the way I am following this tutorial if it matters.
Use the web root on your windows machine. Sounds like Flex wants to know the webroot so it knows where the testing server is. If you do not have a webroot on your windows machine just install Wampserver or XAMPP
You can get away without installing a wamp server. just make sure the Web Root is a folder that acutally exists. then you can ftp the files over the linux machine for testing. Its easier to have the server on the same machine but whatever your preference is.

how to load webapplication on server

I have made a web application using Visual studio 2008. till now it was running on my local host..
Now i want to load it onto the server so that it can run on my company server.
How do i do that..??
Thanks
In visual studio:
Under the Build menu, select Publish
In the publish dialog, select a location to publish your application to
ex: \\server\c$\inetpub\wwwroot
Set your publish options. I reccomend using the "Only files needed to run this application" setting
Click the Publish button
You will have to mark your deployment directory as an application in IIS for IIS to run your code. See this MSDN article for details on how to do this.
You just need to copy it into the IIS directory on that server, usually c:\inetpub\wwwroot. Make sure you have asp.net installed.
You can use the project menu and copy it to a remote server (specifically the machine that will host this project, in addition a web server). Or you can just go to the remote machine, add a new site and store the .aspx pages and all related images on the web servers inetpub\wwwroot folder.

Resources