dotnet.exe .NET Host from commandLine - asp.net-core

When I run my webapi project in VSCode, it is hosted in dotnet.exe .NET Host. Often the process is left open after closing VSCode. It it possible to communicate with it using commandLine?

Related

Run ASP.NET core compiled app with https and command line

When you build an ASP.NET Core executable, if you double click it, it starts the application under http://localhost:5000.
When you run it in Visual Studio it starts with both options (http/https).
Is there any way to do the same when starting the executable? Or at least set it to just start in https instead of http?

How I host asp.net mvc core application to linux server app is developed on window platform

I have to host webapplication which is built on vs 2017 asp.net core window platform.
So do I can host to Linux server?
or its required ubuntu platform for building?
Yes, you can host to linux server. no ubuntu platform required for building asp.net mvc core application.
There are steps to host app on linux or ubantu server.
Step-1. Publishing .net core project in window platform. where project is created.
Step-2. Move publishing build of .net core project folder to linux or ubantu platform.
Step-3. Click on published folder and open that folder -> click on open file in terminal.
Step-4. Below is command to run .net core project in linux machine.
Step-5. Command name - Dotnet projectname.dll EXample: dotnet Webapp1.dll where "webapp1.dll" is the dll of your project.
Step-6. Open browser And Run localhost:5000 in browser. (By default 5000 port is used.)

Deploying a .Net application built in VSTS to a remote agent machine

I have been trying to figure this out for a few days to no avail.
I have an MVC .Net Application that is stored in a GIT repo in VSTS. When I check in code it is being built and unit testa are being run in the cloud.
Now If these unit tests succeed I would like the project to be deployed to a remote machine that has the VSTS agent installed. I can see the agent in the VSTS web interface but I don't know how I get the automatic build to send the completed build to d:/mydeploypath on the remote agent machine.
Is this possible?
Absolutely possible!
There are build steps available to copy files to a remote machine such as Copy Files over SSH and Windows Machine File Copy. But if you are trying to deploy the code to the machine you are building on, you can use the Copy Files step since it won't require credentials. Since it is a web application, there are a few steps like IIS Utilities to stop\start the application pool so the files won't be locked for the deployment.
So using the Copy Files build step, you could use $(Agent.BuildDirectory) as the source directory (or wherever you have your build output going) and set the target folder to your desired destination on the machine.
The build/release variables helped me out a lot during the development of our release process:
https://learn.microsoft.com/en-us/vsts/pipelines/build/variables?view=vsts
The easy way is using WinRM-IIS Web App Deployment task.
To generate the web deployment package, you can specify these arguments in MSBuild Arguments box of Visual Studio Build task:
/p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageLocation="$(build.artifactstagingdirectory)" /P:PackageTempRootDir=""

.Net core - How to create multi-platform executable from a console app

I'm starting to work with .net core 1.1 on a Web API project. The way I'm currently starting my server for the API is by publishing with dotnet publish and then running with dotnet MyProject.dll. Now I have a requirement to start the server from an executable file on Windows and on Linux. I wrote a .net core console app that does just that but the question is how do I wrap in in an executable file for .exe for Windows and what ever it is for Linux...?
I'm just entering the link given in the comment, to mark it as the correct answer.
Self-contained deployment without third-party dependencies

How to deploy a WCF service library with teamcity

I have an old WCF Self-Hosted service (wcf service library project)
So far, this has been published manually in visual studio by right clicking the project, and selecting "Publish".
But I now want to automate this process in teamcity, but there is no "Package" target, so the build fails.
Does teamcity support this kind of projects, or am I forced to keep doing this manually? If it does support it, how?
The only workable solution I found was to create an empty web project and then publish the WCF Service library to that folder, then add the SVC files to the project and have Teamcity publish that.