{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/msbuild/issues/1301","repository_url":"https://api.github.com/repos/Microsoft/msbuild","labels_url":"https://api.github.com/repos/Microsoft/msbuild/issues/1301/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/msbuild/issues/1301/comments","events_url":"https://api.github.com/repos/Microsoft/msbuild/issues/1301/events","html_url":"https://github.com/Microsoft/msbuild/issues/1301","id":186904397,"number":1301,"title":"Replace ignored IO exceptions with path syntax checking","user":{"login":"cdmihai","id":2255729,"avatar_url":"https://avatars.githubusercontent.com/u/2255729?v=3","gravatar_id":"","url":"https://api.github.com/users/cdmihai","html_url":"https://github.com/cdmihai","followers_url":"https://api.github.com/users/cdmihai/followers","following_url":"https://api.github.com/users/cdmihai/following{/other_user}","gists_url":"https://api.github.com/users/cdmihai/gists{/gist_id}","starred_url":"https://api.github.com/users/cdmihai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdmihai/subscriptions","organizations_url":"https://api.github.com/users/cdmihai/orgs","repos_url":"https://api.github.com/users/cdmihai/repos","events_url":"https://api.github.com/users/cdmihai/events{/privacy}","received_events_url":"https://api.github.com/users/cdmihai/received_events","type":"User","site_admin":false},"labels":[{"id":422189537,"url":"https://api.github.com/repos/Microsoft/msbuild/labels/performance","name":"performance","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Microsoft/msbuild/milestones/8","html_url":"https://github.com/Microsoft/msbuild/milestones/Visual%20Studio%2015%20RTM","labels_url":"https://api.github.com/repos/Microsoft/msbuild/milestones/8/labels","id":1919502,"number":8,"title":"Visual Studio 15 RTM","description":"","creator":{"login":"Sarabeth-Jaffe-Microsoft","id":18562889,"avatar_url":"https://avatars.githubusercontent.com/u/18562889?v=3","gravatar_id":"","url":"https://api.github.com/users/Sarabeth-Jaffe-Microsoft","html_url":"https://github.com/Sarabeth-Jaffe-Microsoft","followers_url":"https://api.github.com/users/Sarabeth-Jaffe-Microsoft/followers","following_url":"https://api.github.com/users/Sarabeth-Jaffe-Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Sarabeth-Jaffe-Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Sarabeth-Jaffe-Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sarabeth-Jaffe-Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Sarabeth-Jaffe-Microsoft/orgs","repos_url":"https://api.github.com/users/Sarabeth-Jaffe-Microsoft/repos","events_url":"https://api.github.com/users/Sarabeth-Jaffe-Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Sarabeth-Jaffe-Microsoft/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":14,"state":"open","created_at":"2016-08-02T22:42:51Z","updated_at":"2016-12-02T22:13:05Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2016-11-02T19:58:59Z","updated_at":"2016-12-05T22:42:00Z","closed_at":null,"body":"MSBuild is using IO exceptions to tell whether things are strings or files. This is making it hard for other teams to debug VS (and probably has some perf implications too). We should replace the IO exceptions with path syntax checking.\r\n\r\nThe exceptions seem to be coming from `Path.GetFullPath`, but msbuild may be using other .net APIs too.\r\n\r\nTo check for valid paths we can use something like: https://github.com/Microsoft/msbuild/blob/master/src/Shared/FileUtilities.cs#L526-L536\r\nAnd then refactor all code paths that use exceptions to re-use some common piece of code that validates the path.\r\n\r\nOne way to repro this is to create an empty asp.net core web application and open it."},"comment":{"url":"https://api.github.com/repos/Microsoft/msbuild/issues/comments/265001750","html_url":"https://github.com/Microsoft/msbuild/issues/1301#issuecomment-265001750","issue_url":"https://api.github.com/repos/Microsoft/msbuild/issues/1301","id":265001750,"user":{"login":"danmosemsft","id":6385855,"avatar_url":"https://avatars.githubusercontent.com/u/6385855?v=3","gravatar_id":"","url":"https://api.github.com/users/danmosemsft","html_url":"https://github.com/danmosemsft","followers_url":"https://api.github.com/users/danmosemsft/followers","following_url":"https://api.github.com/users/danmosemsft/following{/other_user}","gists_url":"https://api.github.com/users/danmosemsft/gists{/gist_id}","starred_url":"https://api.github.com/users/danmosemsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danmosemsft/subscriptions","organizations_url":"https://api.github.com/users/danmosemsft/orgs","repos_url":"https://api.github.com/users/danmosemsft/repos","events_url":"https://api.github.com/users/danmosemsft/events{/privacy}","received_events_url":"https://api.github.com/users/danmosemsft/received_events","type":"User","site_admin":false},"created_at":"2016-12-05T22:42:00Z","updated_at":"2016-12-05T22:42:00Z","body":"@cdmihai http://index indexes desktop framework, http://source.dot.net indexes .NET Core, which is what's on GitHub.\r\n\r\nIn .NET Core, although [GetInvalidFileNameChars](http://source.dot.net/#System.Private.CoreLib/corefx/System/IO/Path.Windows.cs,18) and [GetInvalidPathChars](http://source.dot.net/#System.Private.CoreLib/corefx/System/IO/PathInternal.Windows.cs,61) seem to allocate each time, \r\n\r\nInternally though it seems to [be optimized](http://source.dot.net/#System.Private.CoreLib/corefx/System/IO/PathInternal.Windows.cs,183). One way to access that internal code path looks like to do `Path.Combine(yourpath, \"\")` which will check for invalid path characters then return `yourpath`. I'm not sure of a replacement for `GetInvalidFileNameChars` but it looks like you could do the above then also check for `;`, `\\\\`, and `/`.\r\n\r\n@JeremyKuhne sound right?"}}
{"actor":{"display_login":"danmosemsft"}}