简体   繁体   English

VS中的奥尔良谷物收集模板,是否已更改?

[英]Orleans Grain Collection Template in VS, has it changed?

I am using the v1.0.5 release of the Microsoft Orleans SDK and am following along in the Running in a Stand alone Silo Microsoft Orleans Tutorial 我正在使用Microsoft Orleans SDK的v1.0.5版本,并在单独的筒仓中运行 Microsoft Orleans教程

And it suggests the following: 它建议如下:

If you set the grain collection project as a startup project and hit F5, you will notice that it's started and hosted by a silo called "OrleansHost."... 如果将谷物收集项目设置为启动项目并单击F5,则会注意到该项目已由筒仓“ OrleansHost”启动并托管。

But as far as I can the Grain Collection Project is a class library, has this changed since the tutorial was written (I notice that it uses the old OrleansClient and not GrainClient). 但是据我所知,Grain Collection Project是一个类库,自编写本教程以来,这种情况有所改变(我注意到它使用的是旧的OrleansClient而不是GrainClient)。

That main method just below: 主要方法如下:

static void Main(string[] args){
    Console.WriteLine("Waiting`enter code here` for Orleans Silo to start. Press Enter to proceed...");
    Console.ReadLine();
    Orleans.OrleansClient.Initialize("DevTestClientConfiguration.xml");
}

I believe is for the SiloHost. 我相信是针对SiloHost的。

You have to set to Startup both 你必须设置到启动

  • the project containing the Program.cs (the client) and 包含Program.cs的项目(客户端),以及
  • the Grain project. 粮食项目。

See the Grain project's Properties/Debug/Start external program (it should be something like: C:\\Orleans\\SDK\\LocalSilo\\OrleansHost.exe), it will start the grain .dll-s with the local OrleansHost silo in the SDK. 请参阅Grain项目的Properties / Debug / Start外部程序(应该类似于:C:\\ Orleans \\ SDK \\ LocalSilo \\ OrleansHost.exe),它将使用SDK中的本地OrleansHost筒仓启动Grain .dll-s。

You can exit at the end the local OrleansHost silo with CTRL-C. 您可以使用CTRL-C最后退出本地OrleansHost筒仓。

EDIT 编辑

There are 3 lines in the .csproj of the Grain project that is important: Grain项目的.csproj中有3行很重要:

    <StartAction>Program</StartAction>
    <StartProgram>$(OrleansSDK)\LocalSilo\OrleansHost.exe</StartProgram>
    <StartWorkingDirectory>$(OrleansSDK)\LocalSilo</StartWorkingDirectory>

This is inserted by the project template or by the NuGet package, so you do not need to edit these. 它是通过项目模板或NuGet包插入的,因此您无需进行编辑。 Only in case of some problem, eg. 仅在某些问题的情况下,例如。 you relocate the Orleans SDK. 您重新定位Orleans SDK。

When you relocate the SDK, modify the OrleansSDK environment variable (Control panel/Advanced/Environment variables/System variables) and not the Grain project's properties! 重新放置SDK时,请修改OrleansSDK环境变量(“控制面板” /“高级” /“环境”变量/“系统”变量),而不要修改 Grain项目的属性!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM