none
Error: ErrorCode<ERRPS008>:SubStatus<ES0001>:Error: Could not read installat RRS feed

  • 问题

  • I have a web application, it can manage appfabric caching by invoke some appfabric manage command like "Get-CacheHost, Start-CacheCluster" as so on. this command is provide by a work flow program and expose as wcf service. but, when i deploy my service on iis by appfabric host to host it and invoke any command i'll recive the error message "Error: ErrorCode<ERRPS008>:SubStatus<ES0001>:Error: Could not read installation path from registry." . i don't know what installation path the service need to read from registry. any body can help me? thanks.

    below,i will show some information about service configuration and other.

    Service config file:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <system.web>
        <compilation debug="true" targetFramework="4.0"></compilation>
      </system.web>
      
      <system.serviceModel>
        <services>
            <service name="CacheHostService" behaviorConfiguration="netTcpServiceBehavior">
                <endpoint address="net.tcp://localhost:4533/Service/CacheHostService.xamlx" binding="netTcpBinding" bindingConfiguration="PortSharingBinding" contract="ICacheHostService">
                </endpoint>
                <endpoint address="net.tcp://localhost:4533/Service/CacheHostService.xamlx/mex" binding="mexTcpBinding" contract="IMetadataExchange"></endpoint>
            </service>
            
          <service name="CacheClusterService" behaviorConfiguration="netTcpServiceBehavior">
            <endpoint address="net.tcp://localhost:4533/Service/CacheClusterService.xamlx" binding="netTcpBinding" bindingConfiguration="PortSharingBinding" contract="ICacheClusterService">
            </endpoint>
            <endpoint address="net.tcp://localhost:4533/Service/CacheClusterService.xamlx/mex" binding="mexTcpBinding" contract="IMetadataExchange"></endpoint>
          </service>

         

          <service name="CacheService" behaviorConfiguration="netTcpServiceBehavior">
            <endpoint address="net.tcp://localhost:4533/Service/CacheService.xamlx" binding="netTcpBinding" bindingConfiguration="PortSharingBinding" contract="ICacheService">
            </endpoint>
            <endpoint address="net.tcp://localhost:4533/Service/CacheService.xamlx/mex" binding="mexTcpBinding" contract="IMetadataExchange"></endpoint>
          </service>

          <service name="ConfigCommandService" behaviorConfiguration="netTcpServiceBehavior">
            <endpoint address="net.tcp://localhost:4533/Service/ConfigCommandService.xamlx" binding="netTcpBinding" bindingConfiguration="PortSharingBinding" contract="IConfigCommandService">
            </endpoint>
            <endpoint address="net.tcp://localhost:4533/Service/ConfigCommandService.xamlx/mex" binding="mexTcpBinding" contract="IMetadataExchange"></endpoint>
          </service>
        </services>
        <bindings>
          <netTcpBinding>
            <binding name="PortSharingBinding" portSharingEnabled="true">
              <security mode="None"></security>
            </binding>
          </netTcpBinding>
        </bindings>
        <behaviors>
          <serviceBehaviors>
            <behavior name="netTcpServiceBehavior">
              <serviceMetadata httpGetEnabled="false" />
              <serviceDebug includeExceptionDetailInFaults="true" />
              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
              <serviceAuthorization principalPermissionMode="None">
              </serviceAuthorization>
              <serviceThrottling maxConcurrentCalls="2000" maxConcurrentInstances="2000" maxConcurrentSessions="2000" />
              <serviceTimeouts transactionTimeout="00:10:00" />
            </behavior>
                    <behavior name="">
                        <sqlWorkflowInstanceStore instanceCompletionAction="DeleteAll" instanceEncodingOption="None" instanceLockedExceptionAction="NoRetry" connectionStringName="ApplicationServerWorkflowInstanceStoreConnectionString" hostLockRenewalPeriod="00:00:30" runnableInstancesDetectionPeriod="00:00:05" />
                    </behavior>
          </serviceBehaviors>
        </behaviors>
        <!---this code resolve the issue-->
        <serviceHostingEnvironment>
          <baseAddressPrefixFilters>        
            <add prefix="net.tcp://localhost:4533/Service/" />
          </baseAddressPrefixFilters>
        </serviceHostingEnvironment>
        <!--End above-->
      </system.serviceModel>
    <!--runtime section let sub thread impersonation main thread policy-->
        <runtime>
            <legacyImpersonationPolicy enabled="false"/>
            <alwaysFlowImpersonationPolicy enabled="true"/>
        </runtime>
        
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true" />
            <directoryBrowse enabled="true" />
      </system.webServer>
    </configuration>

    core code(how to pass the command to appfabric server):

    internal static Collection<PSObject> InvokeCommand(this Runspace runSpace, string commandName, Dictionary<string, object> parameters = null)
            {
                Command command = new Command(commandName);
                if (parameters != null && parameters.Count > 0)
                {
                    foreach (var item in parameters)
                    {
                        command.Parameters.Add(item.Key, item.Value);
                    }
                }
                WindowsIdentity winId = WindowsIdentity.GetCurrent();
                WindowsImpersonationContext ctx = null;
                Collection<PSObject> results = null; //shell.Invoke();

                try
                {

                    using (ctx = winId.Impersonate())// this code will let the pipelin.invoke() run as main thread's right
                    {
                        using (Pipeline pipeline = runSpace.CreatePipeline())
                        {
                            pipeline.Commands.Add(command);
                            results = pipeline.Invoke();
                        }
                    }
                }
                catch (System.Exception objException)
                {
                    // ctx.Undo();
                    throw objException;
                }

                return results;
              
            }

     

    when program run to " results = pipeline.Invoke()" , the error message will appear. 

     

    in iis manage dasheboard, i have config the server run as a administrater account.

    2012年5月8日 5:34

答案

全部回复