msgraph-training-aspnetmvcapp icon indicating copy to clipboard operation
msgraph-training-aspnetmvcapp copied to clipboard

Cannot find a part of the path '[...]\Graph Tutorial\graph-tutorial\bin\roslyn\csc.exe'.

Open BillStrait opened this issue 6 years ago • 6 comments

I downloaded a fresh copy of the application today from https://developer.microsoft.com/en-us/graph/quick-start. I was warned that I did not have .net 4.7 installed, installed it. The solution loads cleanly, but when I go into debug I get the error "Cannot find a part of the path '[...]\Graph Tutorial\graph-tutorial\bin\roslyn\csc.exe'."

I'm running Visual Studio 2017 15.9.6 on Windows 10.

BillStrait avatar Mar 18 '19 23:03 BillStrait

Running Update-Package -r from the package manager console resolves the error.

BillStrait avatar Mar 19 '19 12:03 BillStrait

Thank you Bill, I had the same problem. Ran OK after that but fails to retrieve anything from the calendar, despite there being one all day event and one meeting. No errors/exceptions, code executes cleanly

waysidefarm avatar Mar 27 '19 09:03 waysidefarm

i had the same problem opening the project in my new copy of Visual Studio 2019. i resolved it by adding the section to the csproj

<Target Name="CopyRoslynFiles" AfterTargets="AfterBuild" Condition="!$(Disable_CopyWebApplication) And '$(OutDir)' != '$(OutputPath)'">
    <ItemGroup>
      <RoslynFiles Include="$(CscToolPath)\*" />
    </ItemGroup>
    <MakeDir Directories="$(WebProjectOutputDir)\bin\roslyn" />
    <Copy SourceFiles="@(RoslynFiles)" DestinationFolder="$(WebProjectOutputDir)\bin\roslyn" SkipUnchangedFiles="true" Retries="$(CopyRetryCount)" RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" />
</Target>

as suggested in the stackoverflow question here

tristian2 avatar Apr 25 '19 14:04 tristian2

Thanks for these reports. Did all of you get the project from the quick-start downloader at https://developer.microsoft.com/en-us/graph/quick-start?platform=option-dotnet?

I reproduce these problems with the zip from the downloader. Updating NuGet packages (except for Microsoft.Identity.Client) in the project seems to fix it for me.

Alternatively you can clone this repo and grab the project from the ./Demos/03-add-msgraph folder, copy your PrivateSettings.config file from your original project, and it should work.

We're updating this training for the 3.x version of MSAL. Once that's done I'll update the ZIP in the quick-start downloader.

jasonjoh avatar May 21 '19 16:05 jasonjoh

It appears that this is a bug with they Roslyn compiler being tracked in their repository: https://github.com/dotnet/roslyn/issues/15556.

Folks have reported the following things fixing the error:

  • Unload/reload project
  • Clean/Rebuild solution
  • Upgrade Nuget packages
  • Modifying the project file as @tristian2 described

jasonjoh avatar Jun 18 '19 14:06 jasonjoh

I had the same problem: take the project you want - move it to another place (like desktop) re-open it and it should work

Hoopou avatar Jul 05 '19 15:07 Hoopou