.NET Core RC2 in service fabric

I want to add a new .NET Core RC2 MVC application to an existing Service Fabric cluster, but I cannot figure out how to do this.

I looked through a few RC1 examples, but this has not yet reached. I understand you need to add EntryPoint to the ServiceManifest.xml file. But in the RC1 example, they point to the dnx.exe file that was deleted 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> 

Which EntryPoint should be used in the RC2 version of .NET Core?

Thanks!

+7
asp.net-core azure-service-fabric
source share
2 answers

Mark this ad:

ASP.NET Core RC2 Announcement

As you can see, your ASP.NET Core application with RC2 becomes a console application.

However, your entry point is your EXE, which exits from compiling your Core console application. ASP.NET

Thus, instead of relying on DNX to get the main method from your Startup.cs, you set up your toolchain in Program.cs, and then just create an EXE that will be used for writing in the application.

 public class Program { public static void Main(string[] args) { var host = new WebHostBuilder() .UseKestrel() .UseStartup<Startup>() .Build(); host.Run(); } } 

So your manifest will be something like this:

 <EntryPoint> <ExeHost> <Program>YourApp.Exe</Program> </ExeHost> </EntryPoint> 
+5
source share

As mentioned in the comment, this should not be a console application. Take a look at https://github.com/weidazhao/Hosting

Clone it and see that the SmsService and CounterService projects are ASP.NET Core 1.0 RC2 projects.

0
source share

All Articles