Build and project bug fixes possibly related to Visual Studio 2017 compatibility #277
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've fixed a few issues I encountered whilst trying to build and use the latest version of Visual Rust.
When trying to build a project generated from the standard Rust Application template, MSBuild would crash, because the json-formatted feedback returned from the cargo build command didn't contain a .message component referenced in the LogRustcMessage function. I've chosen here to just exit the logging function early since there's no real message to log. I'm not sure if the information contained in the parent message object itself is perhaps relevant to the output window still.
When you open a file in a project and save it, the MsBuildFileSystemWatcher would produce an error, because Visual Studio 2017* briefly creates a temporary file in the project directory, and in the process of checking its relevance to the project, the MsBuildFileSystemWatcher would attempt to shorten the path of the file after the temporary file was already removed again. This causes the ToShortPath function to throw a Win32Exception that was not handled in the IsFileAllowed function. Since the file no longer exists, the accessibility of the file is a little irrelevant, so I just caught the error so the function returns false.