4

I have created .net core console app with that launchSettings.json:

    {
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:5000/",
      "sslPort": 0
    }
  },
  "profiles": {
    "Built-in ConsoleApp": {
      "commandName": "IISExpress",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development",
        "ASPNETCORE_URLS": "http://localhost:5000/"
      }
    },
    "Standalone ConsoleApp": {
      "commandName": "Project",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development",
        "ASPNETCORE_URLS": "http://localhost:5000/"
      }
    }
  }
}

In Visual studio 2017 I am using "Standalone ConsoleApp" profile and console app opens.

What is proper way to publish app to other machine ? How can I run app after publish app ?

netmajor
  • 6,507
  • 14
  • 68
  • 100
  • Possible duplicate of [Visual Studio 2017 missing exe file](https://stackoverflow.com/questions/44201334/visual-studio-2017-missing-exe-file) – Kirk Larkin Dec 20 '18 at 09:22

1 Answers1

2

you can use

dotnet c:\path\MyPublishedFolder\MyPublishedProject.Dll

If you need executable .exe, you can to add net472 or any other net framework into your csprof

<TargetFrameworks>netcoreapp2.1;net472</TargetFrameworks>

or you need to create self contained application. Add

 <RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>

or just use

dotnet publish -c Release -r win10-x64
Derviş Kayımbaşıoğlu
  • 28,492
  • 4
  • 50
  • 72
  • How can I run dll or exe with launch profile set? I know that launch profile can be used with csproj, but publish package dont have csproj, only dll or exe. – netmajor Dec 20 '18 at 22:40
  • 1
    launchProfile is for debugging / running application using dotnet.exe or VS. You need to concentrate on Publish Profiles. Publish Profiles also get settings from csproj – Derviş Kayımbaşıoğlu Dec 20 '18 at 22:44