How to deploy asp.net mvc 3 application to remote server msbuild command? - asp.net-mvc-3

I am using
msbuild D:\SVN\QM\QMsln\QM.sln /p:DeployOnBuild=true;PublishProfile=Prof.pubxml
where publish prof Prof.pubxml deploys the web app in my local machine.
It works fine. But now I want to deploy it on remote server. I created a ftp server in my remote machine. And while I tried publishing using VS2012. It throws an error
FTP Passive mode is not available
I googled the issue and inserted
<FtpPassiveMode>True</FtpPassiveMode>
in the Prof.pubxml. But still the problem persists.
Also If I use msbuild it says
This specific web publishing is not yet supported on msbuild command line.
Any idea?

Related

How to provide password for Web Deploy on Visual Studio (Mac)

Environment
MacOS 10.14.6 Mojave, Visual Studio For Mac v8.7.9
API service built on .NET Core framework
Issue: I have a .NET Core project that has a web deploy publish profile to deploy updates to the windows server running on EC2 (IIS).
When I was working on windows, I could easily deploy it through the web deploy UI in the visual studio but after I migrated to the macOS, cannot find such option in the visual studio. I can click on the existing web deploy publish option but it always fails because I need to provide the password somewhere. I tried to add <Password> under the pubxml file but it doesn't read as a valid tag.
Existing publish profiles
Error
/usr/local/share/dotnet/sdk/3.1.403/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : Web deployment task failed. (Connected to the remote computer using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.)
/usr/local/share/dotnet/sdk/3.1.403/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : Make sure the site name, user name, and password are correct. If the issue is not resolved, please contact your local or server administrator.
/usr/local/share/dotnet/sdk/3.1.403/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : Error details:
/usr/local/share/dotnet/sdk/3.1.403/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : Connected to the remote computer ("ec2-3-92-105-216.compute-1.amazonaws.com") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.
/usr/local/share/dotnet/sdk/3.1.403/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : The remote server returned an error: (401) Unauthorized.
Publish failed to deploy.
Currently I have not yet found the answer for that but I've found a kind of work around.
I publish the project to a folder (be careful with dotnet parameters) and after that manually copy files in "bin/Release/netcoreapp3.1/publish" v. ftp to my server.
In order to save a lot of time, it makes sense to copy only newer / different size files.
Not elegant at all, but this is the way how it works for me now.
Will be happy to hear, someone found a solution how to store the password for webdeploy on MacOS

how to set up visual studio for a remote project

Can Visual studio 2019 be used as a local IDE for a solution running on a remote server? specifically i want to create a node.js application on a remote server hosted / provided by my ISP using Vstudio that's running on my local windows machine. I'd like the builds to run on the remote server. Is this possible?
To date, I have been connecting via ssh and just using VIM to create my apps. But I see that VStudio is free and has a lot of support for different types of apps so wanted to give a try.
I launched VStudio and created a new node.js application. Gave it a name (it was pointing to a local folder)
But then when I tried to do was go under Tools -> options ->Cross platform-> connection manager.
I successfully added a connection to my remote server. I know the connection worked because it detected that the remote server is running Ubuntu.
I must be still missing a step because when I try to build, instead of running the build against the remote server, it tries to build locally.
Maybe I can't do this. Maybe I need a local dev environment... build local and then copy the js files over to the target machine.
But jut thought I'd check
Thanks.

Build definition to deploy to remote private server

I have recently learned about Visual Studio Team Services continuous integration and I would like to add a build-step in my build definition to deploy the website files to a remote development server. Similar to what the Azure Web App Deployment does but to my own hosting server. I have figured a way to do this using the Windows Machine File Copy or using a custom PowerShell script, but the problem is, I have to open up my server's ports for SMB to get this working.
Is there a list of IP addresses I could white-list that Visual Studio Team Services uses? From 4 build tests, I managed to get four IP addresses:
- 13.80.13.96
- 40.114.244.33
- 40.114.240.144
- 104.47.152.33
This does not look very promising.
I may be complicating things, so is there a better way of doing this securely?
SMB shouldn't factor into it. The Windows Machine File Copy task uses WinRM. For security, make sure you use HTTPS and valid certificates in place.
There is no list of valid IP address ranges for the hosted build agents that I'm aware of.
You can also add a "Command Line" task to use MSDeploy to publish the website if your private server run with IIS. (Set the "Tool" area in "Command Line" task to "C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" if you are using Hosted Build Agent.)
Some reference links:
Using MSDeploy to publish your site
(MSDeploy) Deploying Contents of a Folder to a Remote IIS Server

VS2010 Publish Project

I am having trouble publishing to a Windows 2003 server in VS2010. In the past (with Vs2008) I just had to include the address of the server - now there are some new publish options such as "web deploy" and what not with some settings that I am not aware of. How do I get the publish working again?
Publish with web deploy stopped working with me also. My server is local so I use the publish method: "File System"
Then you simply have to type the target of your Windows 2003 Server into the "Target Location box.
i.e. \servername\wwwroot\project

How to use CruiseControl.NET for database and windows service deployment?

I have a VS 2008 solutions that includes a number of projects including a couple of class libraries, a web application, a windows service and a SQL 2008 database project. The build server currently has CruiseControl.NET version 1.5.0.6237, command-line subversion client and .NET framework 3.5 SP1 installed (Windows Server 2008 R2, no Visual Studio). I was able to configure ccnet to retrieve get latest from svn repository, build the solution using an MSBuild task and deploy the web application using robocopy. Now I'm struggling to make ccnet deploy the database script and I also need get the windows service deploy and start on the build/dev server. The latest error is that the assembly Microsoft.Data.Schema.Tasks is missing on the build server (I had to add Microsoft.Data.Schema.Common.targets and Microsoft.Data.Schema.SqlTasks.targets files to the solution and modify the database project file to get this far).
What would be the best CI/deployment approach in my scenario? Am I using the right tools for the job, or should I be using something other than ccnet? Do I need to install anything else on the build/dev server to make my life easier?
Please be very specific since I'm new to CruiseControl.NET and MSBuild tasks.
You can use nant.
For a jump start you can use
nantbuilder.
For service install
read this
For a DB deploy read this

Resources