{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vstest/issues/806","repository_url":"https://api.github.com/repos/Microsoft/vstest","labels_url":"https://api.github.com/repos/Microsoft/vstest/issues/806/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vstest/issues/806/comments","events_url":"https://api.github.com/repos/Microsoft/vstest/issues/806/events","html_url":"https://github.com/Microsoft/vstest/issues/806","id":228324357,"number":806,"title":"dotnet test: TypeInitializationException in PlatformEqtTrace","user":{"login":"qmfrederik","id":9918129,"avatar_url":"https://avatars3.githubusercontent.com/u/9918129?v=3","gravatar_id":"","url":"https://api.github.com/users/qmfrederik","html_url":"https://github.com/qmfrederik","followers_url":"https://api.github.com/users/qmfrederik/followers","following_url":"https://api.github.com/users/qmfrederik/following{/other_user}","gists_url":"https://api.github.com/users/qmfrederik/gists{/gist_id}","starred_url":"https://api.github.com/users/qmfrederik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qmfrederik/subscriptions","organizations_url":"https://api.github.com/users/qmfrederik/orgs","repos_url":"https://api.github.com/users/qmfrederik/repos","events_url":"https://api.github.com/users/qmfrederik/events{/privacy}","received_events_url":"https://api.github.com/users/qmfrederik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-12T15:18:38Z","updated_at":"2017-05-16T12:28:07Z","closed_at":null,"body":"## Description\r\nI'm running dotnet test on .NET Core 2.0 Preview 1.\r\n\r\n## Steps to reproduce\r\n\r\n1. Make sure you've got .NET Core 2.0 Preview installed\r\n2. Clone https://github.com/corecompat/system.drawing\r\n3. Run the `.\\clone-mono.ps1` script to make sure the project can build\r\n4. Do dotnet restore of the solution\r\n5. Run `dotnet test --filter \"TestCategory != NotWorking\" test/CoreCompat.System.Drawing.Tests/CoreCompat.System.Drawing.Tests.csproj`\r\n\r\nYou can see the CI output here:\r\nhttps://travis-ci.org/CoreCompat/System.Drawing/builds/231595518\r\nhttps://ci.appveyor.com/project/qmfrederik/system-drawing/build/1.0.128\r\n\r\n## Expected behavior\r\nTests to run & test results to be displayed\r\n\r\n## Actual behavior\r\nAn error occurs:\r\n\r\n```\r\ndotnet test --filter \"TestCategory != NotWorking\" test/CoreCompat.System.Drawing.Tests/CoreCompat.System.Drawing.Tests.csproj\r\nBuild started, please wait...\r\nBuild completed.\r\nTest run for C:\\projects\\system-drawing\\test\\CoreCompat.System.Drawing.Tests\\bin\\Debug\\netcoreapp2.0\\CoreCompat.System.Drawing.Tests.dll(.NETCoreApp,Version=v2.0)\r\nMicrosoft (R) Test Execution Command Line Tool Version 15.3.0-preview-20170502-03\r\nCopyright (c) Microsoft Corporation.  All rights reserved.\r\nStarting test execution, please wait...\r\nTesthost process exited with error: Unhandled Exception: System.TypeInitializationException: The type initializer for 'Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformEqtTrace' threw an exception. ---> System.TypeLoadException: Could not load type 'System.Threading.Monitor' from assembly 'System.Threading, Version=4.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.\r\n   at System.Diagnostics.TraceSource..ctor(String name, SourceLevels defaultLevel)\r\n   at Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformEqtTrace..cctor()\r\n   --- End of inner exception stack trace ---\r\n   at Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformEqtTrace.ShouldTrace(PlatformTraceLevel traceLevel)\r\n   at Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.Error(String format, Object[] args)\r\n   at Microsoft.VisualStudio.TestPlatform.TestHost.Program.Main(String[] args)\r\nCommand exited with code 1\r\n```\r\n\r\n## Environment\r\n> Please share additional details about the test environment.\r\n\r\n.NET Core 2.0 preview 1\r\nReproduces on both Windows & Linux (Travis & AppVeyor)\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/vstest/issues/comments/301766451","html_url":"https://github.com/Microsoft/vstest/issues/806#issuecomment-301766451","issue_url":"https://api.github.com/repos/Microsoft/vstest/issues/806","id":301766451,"user":{"login":"Faizan2304","id":19184362,"avatar_url":"https://avatars1.githubusercontent.com/u/19184362?v=3","gravatar_id":"","url":"https://api.github.com/users/Faizan2304","html_url":"https://github.com/Faizan2304","followers_url":"https://api.github.com/users/Faizan2304/followers","following_url":"https://api.github.com/users/Faizan2304/following{/other_user}","gists_url":"https://api.github.com/users/Faizan2304/gists{/gist_id}","starred_url":"https://api.github.com/users/Faizan2304/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Faizan2304/subscriptions","organizations_url":"https://api.github.com/users/Faizan2304/orgs","repos_url":"https://api.github.com/users/Faizan2304/repos","events_url":"https://api.github.com/users/Faizan2304/events{/privacy}","received_events_url":"https://api.github.com/users/Faizan2304/received_events","type":"User","site_admin":false},"created_at":"2017-05-16T12:28:06Z","updated_at":"2017-05-16T12:28:06Z","body":"@qmfrederik :\r\nIt seems like the culprit here is the content of csproj file `CoreCompat.System.Drawing.Tests.csproj `\r\n https://github.com/CoreCompat/System.Drawing/blob/master/test/CoreCompat.System.Drawing.Tests/CoreCompat.System.Drawing.Tests.csproj#L4 \r\n\r\nChanging the csproj content from \r\n```xml\r\n<Project Sdk=\"Microsoft.NET.Sdk\">\r\n\r\n  <PropertyGroup>\r\n    <TargetFramework>netcoreapp2.0</TargetFramework>\r\n    <TargetFrameworks>netcoreapp2.0;net462</TargetFrameworks>\r\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r\n\r\n    <IsPackable>false</IsPackable>\r\n  </PropertyGroup>\r\n```\r\n\r\nTo \r\n\r\n```xml\r\n<Project Sdk=\"Microsoft.NET.Sdk\">\r\n\r\n  <PropertyGroup>\r\n    <TargetFramework>netcoreapp2.0</TargetFramework>\r\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r\n\r\n    <IsPackable>false</IsPackable>\r\n  </PropertyGroup>\r\n```\r\n\r\nis solving the problem.\r\n\r\nCan you please change as mentioned above and try to run your test.\r\n\r\n"}}
{"actor":{"display_login":"Faizan2304"}}