找不到路径的一部分... BIN \\罗斯林\\ CSC.EXE [英] Could not find a part of the path ... bin\roslyn\csc.exe

查看:3831
本文介绍了找不到路径的一部分... BIN \\罗斯林\\ CSC.EXE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图运行TFS源代码控制检索Asp.net MVC项目。我添加了所有集的引用,我能够构建并成功编译没有任何错误或警告。

I am trying to run Asp.net MVC project retrieved from TFS source control. I have added all assembly references and I am able to build and compile successfully without any error or warning.

但我得到在浏览器中出现以下错误:

But I get the following error in the browser:

找不到路径的一部分
  C:\\ B8akWorkspace \\ B8akProject \\ B8akSolution \\ B8AK.Portal \\ BIN \\罗斯林\\ CSC.EXE。

Could not find a part of the path 'C:\B8akWorkspace\B8akProject\B8akSolution\B8AK.Portal\bin\roslyn\csc.exe'.

下面是错误页面的全屏截图。

Here is a full screenshot of the error page.

在研究了几天,我明白了罗斯林是的.Net编译平台,提供预先编译功能。不过,我不明白为什么我的版本是试图找到\\ BIN \\罗斯林\\ CSC.EXE,因为我并没有设定与罗斯林什么也没有,我打算在我的项目中使用罗斯林。

After few days of research, I understood that Roslyn is .Net complier platform that offers advance compiling features. However, I do not understand why my build is trying to find \bin\roslyn\csc.exe because I did not configure anything related to Roslyn nor I intend to use Roslyn in my project.

推荐答案

用默认VS2015模板的问题是,编译器实际上并没有复制到TFR \\ BIN \\罗斯林\\目录下,而是{OUTDIR} \\罗斯林\\目录

The problem with the default VS2015 templates is that the compiler isn't actually copied to the tfr\bin\roslyn\ directory, but rather the {outdir}\roslyn\ directory

将此code在.csproj的文件:

Add this code in your .csproj file:

<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>


    罗布
  • 学分。

  • 这篇关于找不到路径的一部分... BIN \\罗斯林\\ CSC.EXE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆