mercredi 2 décembre 2015

How do I fix msbuild to prevent 'Could not find a part of the path bin\roslyn\csc.exe'?

I'm trying to correct an issue with building an MVC project in Visual Studio 2015 with a Release configuration. My app is giving me the YSOD:

Could not find a part of the path [...]\bin\roslyn\csc.exe

I can see why it's happening, but I'm having trouble determining the appropriate course of action. The aforementioned roslyn folder is being placed in a sibling folder to my web project folder instead of inside the project's bin directory with the rest of the output, moving the Roslyn folder into the bin directory fixes the issue. In addition to this, it appears as though copies of the csc.exe and other associated executables are being dumped directly into the bin directory directly instead of in the Roslyn directory.

Having checked the answer to Could not find a part of the path ... bin\roslyn\csc.exe, it alludes to the VS2015 template being incorrect and the suggestion is a postbuild event to work around this, but that doesn't seem right to me.

Is there a way to make msbuild put Roslyn in the right place the first time instead of having to complete 2 operations?

Aucun commentaire:

Enregistrer un commentaire