I want to add a new .NET Core RC2 MVC application to an existing Service Fabric cluster, but I can't figure out how I should do this.
I've looked at several RC1 examples but that hasn't gotten me any further either. I understand you need to add an EntryPoint in your ServiceManifest.xml file. But in the RC1 example they point to the dnx.exe, which has been removed in RC2:
<EntryPoint>
<ExeHost>
<Program>approot\runtimes\dnx-clr-win-x64.1.0.0-rc1-update1\bin\dnx.exe</Program>
<Arguments>--appbase approot\src\ChatWeb Microsoft.Dnx.ApplicationHost Microsoft.ServiceFabric.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener</Arguments>
<WorkingFolder>CodePackage</WorkingFolder>
<ConsoleRedirection FileRetentionCount="5" FileMaxSizeInKb="2048" />
</ExeHost>
</EntryPoint>
What EntryPoint should I use in the RC2 version of .NET Core?
Thanks!
Check out this announcement:
Announcing ASP.NET Core RC2
As you can see, your ASP.NET Core application with RC2 becomes a console application.
That said, your entry point is your EXE that comes out from compilation of your ASP.NET Core console application.
So instead on relying on DNX to pickup Main method from your Startup.cs, you setup your toolchain in Program.cs and then just build an EXE that Service Fabric will use for Entry.
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseStartup<Startup>()
.Build();
host.Run();
}
}
So your manifest would be something like this:
<EntryPoint>
<ExeHost>
<Program>YourApp.Exe</Program>
</ExeHost>
</EntryPoint>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With