2

In VS 2015, ASp.NET Core 1, I could deploy my CONSOLE (notice console not web job project) project as a web job directly to azure when publishing the website.

All I had to do was:

  • create the path in the root of my website: app_data\jobs\Triggered\DoSomeWork
  • add this in project.json:

    "publishOptions": { "include": [ "wwwroot", "/.cshtml", "appsettings.json", "web.config", "app_data/jobs//.*" ] },

    "scripts": { "prepublish": [ "bower install", "dotnet bundle" ], "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%", "dotnet publish ..\MyProject.DoSomeWork.WebJob\ -o %publish:OutputPath%\app_data\jobs\Triggered\DoSomeWork\"
    ]
    }

How can I achieve the same in VS2017? I've tried adding some building commands to copy the output of the console webjob to the app_data path, quite messed up. Doesn't work. I spent almost a day trying to figure out this.

I loved project.json!

user2818430
  • 5,853
  • 21
  • 82
  • 148

0 Answers0