title: WCF service running under custom identity resets connection for WSDL's XSD includes
body: <p>I have requirements to configure IIS 6 to host a WCF service targeting .NET Framework 4.0 using a custom identity for the worker process. The identity is a highly restricted domain account that is used to identify and manage the permissions for an entire ecosystem of services that interact in the same business process.</p>
  
  <p>I have run aspnet_regiis.exe with the -ga flag to grant this identity permissions to the relevant ASP.NET locations on the server environment and add it to the IIS_WPG group. For the most part, things seem to work relatively well... except for the auto-generated WSDL specification's includes. Accessing the top-level WSDL spec works fine (i.e. path.to/MyService.svc?wsdl), but IIS 6 is resetting the connection before returning the response for the WSDL's includes (i.e. path.to/MyService.svc?xsd=xsd0, etc). This happens both when accessed via loopback on the server and through the public IP. It does not happen when reconfiguring the app pool to run under the default Network Service account.</p>
  
  <p>I haven't found any documentation for this particular problem, but it's not the first time I've had difficulty with certain bits of the .NET Framework not quite working correctly when the IIS 6 worker process is running under a custom domain identity. I haven't configured any special privileges in the Local Security Policy for this account, other than the pre-configured permission for members of IIS_WPG to log on as a batch job. What might I be missing to get the worker functioning correctly?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The Event Viewer contains no errors and IIS logs show the server responding with 200 OK to the request, but the full status value is <code>200 0 64</code>, indicating a Win32 status code of 64.</p>
  
  <p>The dump I receive on that error from <code>net helpmsg 64</code> is as follows:</p>
  
  <blockquote>
    <p>The specified network name is no longer available.</p>
  </blockquote>
  
  <p>Responses from various entities are below:</p>
  
  <ul>
  <li><strong>Chrome:</strong> Error 101 (net::ERR_CONNECTION_RESET): The connection was reset</li>
  <li><strong>Firefox:</strong> The connection to the server was reset while the page was loading</li>
  <li><strong>Eclipse/Java:</strong> java.net.SocketException: Connection reset</li>
  </ul>
  
  <p><strong>EDIT:</strong></p>
  
  <p><a href="https://stackoverflow.com/questions/7016005/simple-tracing-in-asp-net-4/7016488#7016488">Service logging</a> (provided by <a href="https://stackoverflow.com/users/168056/bnl">BNL</a>) produced the following exception dump:</p>
  
  <blockquote>
    <p>System.InvalidOperationException: Unable to generate a temporary class
    (result=1). error CS2001: Source file 'C:\WINDOWS\TEMP\vxmgwmnl.0.cs'
    could not be found. error CS2008: No inputs specified.</p>
    
    <p>at System.Xml.Serialization.Compiler.Compile(Assembly parent, String
    ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
      at
    System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[]
    xmlMappings, Type[] types, String defaultNamespace, Evidence evidence,
    XmlSerializerCompilerParameters parameters, Assembly assembly,
    Hashtable assemblies)     at
    System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings,
    Type[] types, String defaultNamespace, String location, Evidence
    evidence)     at System.Xml.Serialization.XmlSerializer..ctor(Type type,
    String defaultNamespace)  at
    System.Xml.Schema.XmlSchema.Write(XmlWriter writer,
    XmlNamespaceManager namespaceManager)     at
    System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.XmlSchemaMessage.OnWriteBodyContents(XmlDictionaryWriter
    writer)   at
    System.ServiceModel.Channels.Message.OnWriteMessage(XmlDictionaryWriter
    writer)   at
    System.ServiceModel.Channels.BufferedMessageWriter.WriteMessage(Message
    message, BufferManager bufferManager, Int32 initialOffset, Int32
    maxSizeQuota)     at
    System.ServiceModel.Channels.TextMessageEncoderFactory.TextMessageEncoder.WriteMessage(Message
    message, Int32 maxMessageSize, BufferManager bufferManager, Int32
    messageOffset)    at
    System.ServiceModel.Channels.HttpOutput.SerializeBufferedMessage(Message
    message)  at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan
    timeout)  at
    System.ServiceModel.Channels.HttpRequestContext.OnReply(Message
    message, TimeSpan timeout)    at
    System.ServiceModel.Channels.RequestContextBase.Reply(Message message,
    TimeSpan timeout)     at
    System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Reply(MessageRpc&amp;
    rpc)</p>
  </blockquote>