MSBuild - roslyn files are copied to the wrong location

431 views
Skip to first unread message

Ken Corley

unread,
Feb 21, 2017, 12:52:09 PM2/21/17
to Jenkins Users
Running Jenkins 2.19.2 and 1.27 MSBuild plugin.

Job is compiling a VS 2015 MVC 5 app.

Job has been trucking along nicely.

When I set <MvcBuildViews>true</MvcBuildViews> on the project file to precompile the Views, I get a failure:

(MvcBuildViews target) -> 
  ASPNETCOMPILER : error ASPRUNTIME: Could not find a part of the path 'C:\Jenkins\MailIV.com.Build\_PublishedWebsites\MailIV.com\bin\roslyn\csc.exe'. [C:\Program Files (x86)\Jenkins\workspace\MailIV.com\MailIV.com\MailIV.com.csproj]

It turns out that the roslyn files that are supposed to be copied to /bin/roslyn/ are copies into /bin/ instead.

I've tried a number of variations of this build command in the project file to no avail

<Target Name="CopyRoslynFiles" AfterTargets="AfterBuild" >
  <ItemGroup>
    <RoslynFiles Include="$(SolutionDir)packages\Microsoft.Net.Compilers.1.1.1\tools\*" />
  </ItemGroup>
  <MakeDir Directories="$(WebProjectOutputDir)\bin\roslyn" />
  <Copy SourceFiles="@(RoslynFiles)" DestinationFolder="$(WebProjectOutputDir)\bin\roslyn" SkipUnchangedFiles="true" Retries="$(CopyRetryCount)" RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" />
</Target>

Does anyone know how to get this to run correctly and/or know why the files are being copied to the wrong location?

Thanks -Ken
Reply all
Reply to author
Forward
0 new messages