locked
xunit crashing "dotnet has stopped working" VS-2015 RRS feed

  • Question


  • I created project which represents a business logic layer exposing a bare minimal class with bare minimal functionality.  Then I created a xunit project with small simplistic tests.  I compile and almost time after time I get a popup dialog stating "dotnet has stopped working".  r-click rebuild all, it might happen again.  r-click rebuild all and it might work. 

    In my main project with much more complex test, it happens almost all the time.  Every team member is see this issue to some degree.  Yes, of course, I googled the problem.  You get bits of information that really dont seem to apply or work.  Clear cache, make sure you aren't referencing multiple........Visual Studio 2017 is better but not perfect; you frequently get an error message that says it cannot connect to some host when you try to debug.

    It just seems everyone should be having this problem is to prevalent.  Any information needs or questions please ask, I appreciate your help.

    Any ideas?

    project.json

    {
      "version": "1.0.0.0",
      "testRunner": "xunit",
      "dependencies": {
        "xunit": "2.2.0-beta4-build3444",
        "Microsoft.NETCore.App": "1.1.0",
        "Microsoft.DotNet.InternalAbstractions": "1.0.500-preview2-1-003177",
        "xxxxxxxx.Api": "1.0.0-*",
        "dotnet-test-xunit": "2.2.0-preview2-build1029",
        "Moq": "4.7.1",
        "xxxxxxxx.Workflow.Api": "1.0.0-*",
        "xunit.runner.console": "2.2.0"
      },
      "frameworks": {
        "netcoreapp1.1": {
          "dependencies": {
          }
        }
      },
      "runtimes": {
        "win10-x64": {},
        "win81-x64": {},
        "win8-x64": {},
        "win7-x64": {}
      }
    }

    Here is the error from the Output window

    ------ Discover test started ------
    ========== Discover test finished: 0 found (0:00:00.4458308) ==========
    ------ Discover test started ------
    Discovering tests in 'C:\Dev\EMSConnect\Main\Source\webAPI\EMSContent\src\xxxx.Audit.Api.Test\project.json' ["C:\Program Files\dotnet\dotnet.exe" test "C:\Dev\EMSConnect\Main\Source\webAPI\EMSContent\src\xxxx.Audit.Api.Test\project.json" --port 3294]
    Unable to start C:\Program Files\dotnet\dotnet.exe
    dotnet-test Error: 0 : [ReportingChannel]: Waiting for message failed Newtonsoft.Json.JsonReaderException: After parsing a value an unexpected character was encountered: :. Path 'Payload.CodeFilePath', line 1, position 93.
       at Newtonsoft.Json.JsonTextReader.ParsePostValue()
       at Newtonsoft.Json.JsonTextReader.Read()
       at Newtonsoft.Json.JsonWriter.WriteToken(JsonReader reader, Boolean writeChildren, Boolean writeDateConstructorAsDate, Boolean writeComments)
       at Newtonsoft.Json.Linq.JTokenWriter.WriteToken(JsonReader reader, Boolean writeChildren, Boolean writeDateConstructorAsDate, Boolean writeComments)
       at Newtonsoft.Json.JsonWriter.WriteToken(JsonReader reader, Boolean writeChildren)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateJToken(JsonReader reader, JsonContract contract)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
       at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
       at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
       at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
       at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
       at Microsoft.DotNet.Tools.Test.ReportingChannel.ReadMessages()

    Unhandled Exception: Newtonsoft.Json.JsonReaderException: After parsing a value an unexpected character was encountered: :. Path 'Payload.CodeFilePath', line 1, position 93.
       at Newtonsoft.Json.JsonTextReader.ParsePostValue()
       at Newtonsoft.Json.JsonTextReader.Read()
       at Newtonsoft.Json.JsonWriter.WriteToken(JsonReader reader, Boolean writeChildren, Boolean writeDateConstructorAsDate, Boolean writeComments)
       at Newtonsoft.Json.Linq.JTokenWriter.WriteToken(JsonReader reader, Boolean writeChildren, Boolean writeDateConstructorAsDate, Boolean writeComments)
       at Newtonsoft.Json.JsonWriter.WriteToken(JsonReader reader, Boolean writeChildren)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateJToken(JsonReader reader, JsonContract contract)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
       at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
       at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
       at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
       at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
       at Microsoft.DotNet.Tools.Test.ReportingChannel.ReadMessages()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    ========== Discover test finished: 0 found (0:00:18.1389737) ==========


    • Edited by MEB123 Tuesday, March 14, 2017 9:53 PM Added more information
    Tuesday, March 14, 2017 9:32 PM

All replies

  • Hi MEB123,

    >>dotnet-test Error: 0 : [ReportingChannel]: Waiting for message failed Newtonsoft.Json.JsonReaderException: After parsing a value an unexpected character was encountered: :. Path 'Payload.CodeFilePath', line 1, position 93.

    According to above error, there is an unexpected character when using Newtonsoft.Json. Please check your code in line 1, position 93.

    >>Unable to start C:\Program Files\dotnet\dotnet.exe

    Against this error, please try do the flowing steps:

    1). Run VS in administrator.

    2). Close VS and delete the project.lock.json file, then re-open VS.

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, March 15, 2017 2:54 AM
  • Oscar,

    Thank you for your response.  Regarding the Newtonsoft issue, I can r-click rebuild the same source code and have it generate the tests, then do it again to the same source and I'll get the "dotnet stopped working error."

    I tried your delete project.lock.json suggestion.  I'm still seeing this issue happening.  The discover of the tests shows this error now.  I'm also running as administrator.  Thanks again!

    ------ Discover test started ------
    ========== Discover test finished: 0 found (0:00:00.5024292) ==========
    ------ Discover test started ------
    Discovering tests in 'C:\Dev\EMSConnect\Main\Source\webAPI\EMSContent\src\Deloitte.Audit.Api.Test\project.json' ["C:\Program Files\dotnet\dotnet.exe" test "C:\Dev\EMSConnect\Main\Source\webAPI\EMSContent\src\Deloitte.Audit.Api.Test\project.json" --port 2188]
    Unable to start C:\Program Files\dotnet\dotnet.exe
    dotnet-test Error: 0 : [ReportingChannel]: Waiting for message failed System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
       at System.IO.BinaryReader.ReadString()
       at Microsoft.DotNet.Tools.Test.ReportingChannel.ReadMessages()

    Unhandled Exception: System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
       at System.IO.BinaryReader.ReadString()
       at Microsoft.DotNet.Tools.Test.ReportingChannel.ReadMessages()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    ========== Discover test finished: 0 found (0:00:20.603995) ==========

    Wednesday, March 15, 2017 4:05 PM
  • Hi MEB,

    Would you please share me a detailed steps that I could repro your issue in my side, and please create a new project to see whether has the same issue.

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, March 17, 2017 9:22 AM
  • Hi guys, 

    I'm having the same problem in my machine? Have you sorted? 

    Thanks

    Tuesday, November 28, 2017 4:04 PM