在调用Orleans.GrainClient.GetStreamProviders()和Orleans.GrainClientGetStream()之后,我得到了System.NullReferenceException。我尝试在配置文件和代码中添加StreamPorvider。像GetGrain()这样的其他方法工作得很好。
我的配置文件:
<?xml version="1.0" encoding="utf-8" ?>
<!--
This is a sample client configuration file.
For a detailed reference, see "Orleans Configuration Reference.html".
-->
<ClientConfiguration xmlns="urn:orleans">
<GatewayProvider ProviderType="Config"/>
<Gateway Address="localhost" Port="30000"/>
<Statistics MetricsTableWriteInterval="30s" PerfCounterWriteInterval="30s" LogWriteInterval="300s" WriteLogStatisticsToTable="true"/>
<StreamProviders>
<Provider Type="Orleans.Providers.Streams.SimpleMessageStream.SimpleMessageStreamProvider" Name="PubSubType" FireAndForgetDelivery="false"/>
<!--<Provider Type="Orleans.Providers.Streams.Persistent.AzureQueueStreamProvider" Name="AzureQueueProvider" DataConnectionString=""/> -->
</StreamProviders>
</ClientConfiguration>和错误堆栈跟踪
HttpException (0x80004005):对象引用未设置为对象的实例。
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9964625
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +339
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
[HttpException (0x80004005): Object reference not set to an instance of an object.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9946132
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +90
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261发布于 2016-07-02 13:54:15
您需要在思洛存储器配置中具有相同的流配置,而不仅仅是客户端。检查名称和所有参数是否匹配(复制\粘贴部分;)
https://stackoverflow.com/questions/38058809
复制相似问题