If you were adding ASPNETCOMPILER to compile your Razor views in MVC, like in this StackOverflow question, then change PhysicalPath to place where Roslyn nuget package is located (usually pointed via $CscToolPath variable):
<Target Name="AfterBuild" Condition="'$(MvcBuildViews)'=='true'"><AspNetCompiler VirtualPath="temp" PhysicalPath="$(CscToolPath)" />