- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我最近构建了一个新的 TFS 2018(更新 3)服务器并添加了 Visual Studio 构建工具 (v15.7.1)。创建一个非常简单的 C# 项目后,服务器构建失败并显示错误 MSB6006:“csc.exe”以代码 1 退出。我打开调试并发现错误
Could not load file or assembly 'Microsoft.CodeAnalysis.CSharp, Version=2.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (TaskId:32)
我的项目没有引用这个库,我在项目级别关闭了代码分析,所以我认为这是 VS 构建工具的问题。有谁知道解决此问题的解决方法或方法?
我还注意到更新版本的 VS Build Tools (v15.8)。我还没有尝试更新构建服务器,因为生成离线包、压缩、上传等的复杂性很高,但如果找不到短期修复,我将努力进行下一步。
基本上,我们的新服务器在没有解决方案的情况下已经死了,所以我希望这里有人能给出答案,否则,我最终可能会为了更可靠的东西而放弃这一切。
最佳答案
似乎是版本 15.7.1 中的错误。目前尚不清楚是否有任何其他版本受到此错误的影响,但将 VS Build Tools 升级到 15.8.2 解决了该问题。
要发现错误 MSB6006 的根本问题:“csc.exe”以代码 1 退出,请在 MSBuild 参数中设置以下标志:
/v:diag
这将产生类似于以下的内容:
2018-08-29T21:07:25.0630293Z Task Parameter:WarningLevel=4 (TaskId:23)
2018-08-29T21:07:25.0630927Z C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\Roslyn\csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Net.Http.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Xml.Linq.dll" /debug:pdbonly /filealign:512 /optimize+ /out:obj\Release\Epay.Common.Core.dll /ruleset:"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Team Tools\Static Analysis Tools\\Rule Sets\MinimumRecommendedRules.ruleset" /subsystemversion:6.00 /target:library /utf8output Extensions\ObjectExtensions.cs Properties\AssemblyInfo.cs "C:\Windows\TEMP\.NETFramework,Version=v4.6.1.AssemblyAttributes.cs" (TaskId:23)
2018-08-29T21:07:25.0631621Z Using shared compilation with compiler from directory: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\Roslyn (TaskId:23)
2018-08-29T21:07:25.5959306Z 16:07:24.786 6>CoreCompile: (TargetId:111)
2018-08-29T21:07:25.5959917Z Could not load file or assembly 'Microsoft.CodeAnalysis.CSharp, Version=2.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (TaskId:63)
2018-08-29T21:07:25.6127920Z ##[error]C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\Roslyn\Microsoft.CSharp.Core.targets(52,5): Error MSB6006: "csc.exe" exited with code 1.
2018-08-29T21:07:25.6128554Z 16:07:25.608 6>C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\Roslyn\Microsoft.CSharp.Core.targets(52,5): error MSB6006: "csc.exe" exited with code 1. [D:\TfsData\BA01\_work\8\s\Epay.Common\Security\Security.csproj]
2018-08-29T21:07:25.6141937Z Output Item(s): CscCommandLineArgs= (TaskId:63)
2018-08-29T21:07:25.6143738Z Done executing task "Csc" -- FAILED. (TaskId:63)
关于c# - TFS 2018 构建失败,出现错误 MSB6006 : "csc.exe" exited with code 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52082106/
有没有办法针对当前工作目录以外的文件夹运行 csc,或者最好的做法是将 .cs 文件复制到当前工作目录,然后运行 csc? 最佳答案 是的,您可以为您的文件使用完整路径名但是,IMO 最简单的做法
我想从字符串编译 c# 源代码。我知道使用 CodeDom 可以做到这一点,我想知道是否可以使用命令行编译器来做到这一点。例如,假设我将以下代码加载到一个字符串上: static void Main(
我有一个包含多个项目的 Visual Studio 解决方案,特别是 DotNet5 asp.net 应用程序,其中包含多个 netstandard 2.0 引用。它在调试器中构建并运行良好,但不断抛
我有一个稀疏矩阵 X ' with 5082518 stored elements in Compressed Sparse Column format> 我有一个数组 columns_to_use
我正在使用 team city 调用 nant 脚本,目前这个 nant 脚本非常简单,仅在解决方案中的单个项目上调用 msbuild 任务。 构建失败,看起来正在调用 msbuild 3.5,但它错
至少我有以下稀疏矩阵: A = sparse([1 4 7; 2 5 8; 3 6 9]) 什么是最有效的获取方式: A = sparse([1 0 7; 2 0 8; 3 0 9]) 我使用的实际矩
至少我有以下稀疏矩阵: A = sparse([1 4 7; 2 5 8; 3 6 9]) 什么是最有效的获取方式: A = sparse([1 0 7; 2 0 8; 3 0 9]) 我使用的实际矩
我通过 Visual Studio Code 快速更改我的代码。如您所知,它没有内置编译器,所以我通过 CMD 使用 CSC。 它只适用于(代码 <= C# 4.6 & 代码 <= .NET 4.5)
所以我有两个不同形状的 csc 矩阵需要相加。矩阵看起来像这样: current_flows = (7005, 1001) 50.0 (8259, 1001) 65.0 (14007, 1
我正在按照教程在 C# 应用程序中使用 WSDL: http://my.execpc.com/~gopalan/dotnet/webservices/webservice_csharp_client.
我在一个目录中有多个 C# 源文件(大约 50 个)。我想要做的是分别编译它们,即它们中的每一个都应该生成自己的可执行文件。 (有些文件有一个或两个目录深。) 目前我正在做的是 csc *.cs /r
我在 VS2010 中有一个 C# 项目,它生成一个 DLL,里面有一个 COM 对象。 为了注册免费 COM,我想将 list 嵌入为 Win32 资源。因此,我需要将 /win32res:blah
我一直在从事一个项目,随着项目的发展,我意识到无法连接在一起的两个部分是相互依赖的。 我们将这两个部分称为a.exe 和b.dll。 b.dll 提供了一个允许 a.exe 检索数据的实现,但我希望它
在努力创建数据库(首先使用实体框架,然后没有)之后,我们有了一个数据库(和一个我们不使用的 EntityModel_HFFContext 文件,它没有连接)。正常工作继续进行,我为 MVC 站点地
这个问题在这里已经有了答案: How to get csc.exe path? (10 个答案) 关闭 5 年前。 我是 C# 的新手,我正在尝试使用 cmd 编译一个名为 test.cs 的基本
我正在使用 csc.exe 编译一个项目, 与 /analyzer:指向 ErrorProne.Net.CoreAnalyzers.dll 路径的标志和 ErrorProne.Net.Core.dll
我有一个关于TFS的项目,该项目正在除我的人以外的其他所有人的机器上工作。在构建时,出现了可以在图像中看到的错误。 “指定的任务可执行文件位置csc.exe无效。”当前正在尝试修复VS 2017。 最
当我使用 msbuild 从命令行构建解决方案时,我没有像 Visual Studio 那样从 csharp 编译器 (Csc) 获得任何输出。 例如,如果我在 Visual Studio 中构建解决
我刚刚将VS2019社区版本更新为版本16.7.2。我的项目开始因以下错误而无法构建(也许是链接步骤?)(以前构建得很好,我认为是在v16.6.something上): > Severity Cod
我想知道 msbuild.exe 如何执行 C# 应用程序。 当我在谷歌搜索时,我开始了解 csc.exe、PE 文件、JIT、IL 文件。 msbuild.exe 在内部调用 csc.exe 来编译
我是一名优秀的程序员,十分优秀!