{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/msbuild/issues/3002","repository_url":"https://api.github.com/repos/Microsoft/msbuild","labels_url":"https://api.github.com/repos/Microsoft/msbuild/issues/3002/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/msbuild/issues/3002/comments","events_url":"https://api.github.com/repos/Microsoft/msbuild/issues/3002/events","html_url":"https://github.com/Microsoft/msbuild/issues/3002","id":297913995,"node_id":"MDU6SXNzdWUyOTc5MTM5OTU=","number":3002,"title":"Csc task cannot be found when using custom toolset","user":{"login":"dfederm","id":6445614,"node_id":"MDQ6VXNlcjY0NDU2MTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6445614?v=4","gravatar_id":"","url":"https://api.github.com/users/dfederm","html_url":"https://github.com/dfederm","followers_url":"https://api.github.com/users/dfederm/followers","following_url":"https://api.github.com/users/dfederm/following{/other_user}","gists_url":"https://api.github.com/users/dfederm/gists{/gist_id}","starred_url":"https://api.github.com/users/dfederm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dfederm/subscriptions","organizations_url":"https://api.github.com/users/dfederm/orgs","repos_url":"https://api.github.com/users/dfederm/repos","events_url":"https://api.github.com/users/dfederm/events{/privacy}","received_events_url":"https://api.github.com/users/dfederm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-16T20:42:41Z","updated_at":"2018-09-05T15:50:30Z","closed_at":null,"author_association":"MEMBER","body":"### Steps to reproduce\r\n\r\nMinimal repro located here: https://github.com/dfederm/msbuild/tree/csc-not-found-custom-toolset/src/Samples/CscNotFoundWithCustomToolset\r\n\r\nAfter building, run something like:\r\n```\r\n\"D:\\msbuild\\artifacts\\Debug\\bin\\Samples\\CscNotFoundWithCustomToolset\\net46\\CscNotFoundWithCustomToolset.exe\" \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\MSBuild\\15.0\\Bin\\\"\r\n```\r\n\r\n### Expected  behavior\r\nThe Compile target succeeds\r\n\r\n### Actual behavior\r\nOutput:\r\n```\r\n__________________________________________________\r\nProject \"D:\\msbuild\\src\\Samples\\CscNotFoundWithCustomToolset\\Test.csproj\" (Compile target(s)):\r\n\r\nC:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\MSBuild\\15.0\\Bin\\Roslyn\\Microsoft.CSharp.Core.targets(84,5): error MSB4062: The \"Microsoft.CodeAnalysis.BuildTasks.Csc\" task could not be loaded from the assembly \\Microsoft.Build.Tasks.CodeAnalysis.dll. Could not load file or assembly 'file:///D:\\Microsoft.Build.Tasks.CodeAnalysis.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.\r\nDone building project \"Test.csproj\" -- FAILED.\r\nCompile failed\r\n```\r\n\r\n### Environment data\r\nUsing the latest version of Microsoft.Build.Runtime (15.5.180.1)\r\n\r\n\r\n### Other\r\nTalked with @cdmihai and one guess to a solution would be to change Microsoft.Common.tasks from:\r\n```\r\n<UsingTask TaskName=\"Microsoft.CodeAnalysis.BuildTasks.Csc\" AssemblyFile=\"Microsoft.Build.Tasks.CodeAnalysis.dll\" />\r\n```\r\n\r\nto \r\n```\r\n<UsingTask TaskName=\"Microsoft.CodeAnalysis.BuildTasks.Csc\" AssemblyFile=\"$(RoslynTargetsPath)\\Microsoft.Build.Tasks.CodeAnalysis.dll\" />\r\n```\r\n\r\nThat way it always looks next to Roslyn adjacent to the same place it imported the targets from.\r\n\r\nOr actually I wonder why the Roslyn tasks aren't defined as a `<UsingTask>` in the Roslyn targets in the first place like any other task. IMHO the Csc task doesn't need to be \"special\"."},"comment":{"url":"https://api.github.com/repos/Microsoft/msbuild/issues/comments/418781957","html_url":"https://github.com/Microsoft/msbuild/issues/3002#issuecomment-418781957","issue_url":"https://api.github.com/repos/Microsoft/msbuild/issues/3002","id":418781957,"node_id":"MDEyOklzc3VlQ29tbWVudDQxODc4MTk1Nw==","user":{"login":"rainersigwald","id":3347530,"node_id":"MDQ6VXNlcjMzNDc1MzA=","avatar_url":"https://avatars1.githubusercontent.com/u/3347530?v=4","gravatar_id":"","url":"https://api.github.com/users/rainersigwald","html_url":"https://github.com/rainersigwald","followers_url":"https://api.github.com/users/rainersigwald/followers","following_url":"https://api.github.com/users/rainersigwald/following{/other_user}","gists_url":"https://api.github.com/users/rainersigwald/gists{/gist_id}","starred_url":"https://api.github.com/users/rainersigwald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainersigwald/subscriptions","organizations_url":"https://api.github.com/users/rainersigwald/orgs","repos_url":"https://api.github.com/users/rainersigwald/repos","events_url":"https://api.github.com/users/rainersigwald/events{/privacy}","received_events_url":"https://api.github.com/users/rainersigwald/received_events","type":"User","site_admin":false},"created_at":"2018-09-05T15:50:30Z","updated_at":"2018-09-05T15:50:30Z","author_association":"CONTRIBUTOR","body":"@manish10sharma I think that is a distinct problem. Are you also using a custom MSBuild host executable? If so, I suspect you need to add binding redirects for MSBuild assemblies to the 15.0 versions. Using the [Microsoft.Build.Locator package](https://docs.microsoft.com/en-us/visualstudio/msbuild/updating-an-existing-application?view=vs-2017) can help with that."}}
{"actor":{"display_login":"rainersigwald"}}