{"action":"created","issue":{"url":"https://api.github.com/repos/xunit/xunit/issues/508","labels_url":"https://api.github.com/repos/xunit/xunit/issues/508/labels{/name}","comments_url":"https://api.github.com/repos/xunit/xunit/issues/508/comments","events_url":"https://api.github.com/repos/xunit/xunit/issues/508/events","html_url":"https://github.com/xunit/xunit/issues/508","id":97607033,"number":508,"title":"Using Assert.Throws in a .NET 4.5.1 breaks builds","user":{"login":"behrangsa","id":18451,"avatar_url":"https://avatars.githubusercontent.com/u/18451?v=3","gravatar_id":"","url":"https://api.github.com/users/behrangsa","html_url":"https://github.com/behrangsa","followers_url":"https://api.github.com/users/behrangsa/followers","following_url":"https://api.github.com/users/behrangsa/following{/other_user}","gists_url":"https://api.github.com/users/behrangsa/gists{/gist_id}","starred_url":"https://api.github.com/users/behrangsa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/behrangsa/subscriptions","organizations_url":"https://api.github.com/users/behrangsa/orgs","repos_url":"https://api.github.com/users/behrangsa/repos","events_url":"https://api.github.com/users/behrangsa/events{/privacy}","received_events_url":"https://api.github.com/users/behrangsa/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-28T03:35:44Z","updated_at":"2015-09-09T01:28:46Z","closed_at":"2015-09-05T20:39:58Z","body":"In a .NET 4.5.1 project, if I use `Assert.Throws`, I am getting this error:\r\n\r\n```\r\nThe type 'System.Threading.Tasks.Task' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Threading.Tasks, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.\r\n```\r\n\r\nI am using xUnit version `2.1.0.3029`. The xUnit.net Assertion Library version is `2.1.0-beta3-build3029`.\r\n\r\nAre there any workarounds available for this?"},"comment":{"url":"https://api.github.com/repos/xunit/xunit/issues/comments/138747239","html_url":"https://github.com/xunit/xunit/issues/508#issuecomment-138747239","issue_url":"https://api.github.com/repos/xunit/xunit/issues/508","id":138747239,"user":{"login":"behrangsa","id":18451,"avatar_url":"https://avatars.githubusercontent.com/u/18451?v=3","gravatar_id":"","url":"https://api.github.com/users/behrangsa","html_url":"https://github.com/behrangsa","followers_url":"https://api.github.com/users/behrangsa/followers","following_url":"https://api.github.com/users/behrangsa/following{/other_user}","gists_url":"https://api.github.com/users/behrangsa/gists{/gist_id}","starred_url":"https://api.github.com/users/behrangsa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/behrangsa/subscriptions","organizations_url":"https://api.github.com/users/behrangsa/orgs","repos_url":"https://api.github.com/users/behrangsa/repos","events_url":"https://api.github.com/users/behrangsa/events{/privacy}","received_events_url":"https://api.github.com/users/behrangsa/received_events","type":"User","site_admin":false},"created_at":"2015-09-09T01:28:46Z","updated_at":"2015-09-09T01:28:46Z","body":"Hi all,\r\n\r\nI think I had actually made a mistake. Make sure you are using the correct .NET version, uninstall xunit, make sure it and all of its dependencies are removed from `package.config`, and reinstall xunit.\r\n\r\nIn short, make sure the `targetFramework` matches the NET version for your project:\r\n\r\n```\r\n<package id=\"...\" version=\"...\" targetFramework=\"net451\" />\r\n```"}}