How to publish console app as a WebJob rather than Web App #7677
Comments
Hi @Liero. |
@mkArtakMSFT: My WebJob is supposed to send email reminders in background, but in order to use Razor as "mail templates" I had to reference the web sdk |
@pranavkm, can you please look into this one? Thanks! |
What's the exception you're seeing? You likely need to set |
@pranavkm, you are right about the exception and setting PreserveCompilationContext does help indeed. This solves my situation (feel free to close the issue), but:
|
The Web.Sdk is opinionated about the kind of target you're deploying it and shows a dialog best suited for their targets. Not sure if there's a way to change this behavior - you could try asking at https://github.com/aspnet/websdk. |
Hi,
I have a console app that I want to deploy as web job. It's based on Entropy/samples/Mvc.RenderViewToString/ sample.
The problem is, that is uses
Microsoft.NET.Sdk.Web
rather thanMicrosoft.NET.Sdk
in order to render the razor views although it is not web application.When I invoke the publish dialog, it publishes it as web app, not as web job. When I replace
Microsoft.NET.Sdk.Webwith Microsoft.NET.Sdk, it shows the correct web job publish dialog, but then I get runtime exception when I try to invoke the razor view.The text was updated successfully, but these errors were encountered: