重新安装后,我在Visual Studio Community 2015中的任何构建/任何项目上都出现了构建错误。
构建错误是:
1>------ Build started: Project: TestConsoleApp, Configuration: Debug Any CPU ------
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.VisualBasic.Core.targets(56,5): error MSB3883: Unexpected exception:
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.VisualBasic.Core.targets(56,5): error : System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.VisualBasic.Core.targets(56,5): error : at System.Security.Cryptography.SHA256Managed..ctor()
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.VisualBasic.Core.targets(56,5): error : --- End of inner exception stack trace ---
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.VisualBasic.Core.targets(56,5): error : at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.VisualBasic.Core.targets(56,5): error : at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.VisualBasic.Core.targets(56,5): error : at System.Security.Cryptography.CryptoConfig.CreateFromName(String name, Object[] args)
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.VisualBasic.Core.targets(56,5): error : at System.Security.Cryptography.SHA256.Create()
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.VisualBasic.Core.targets(56,5): error : at Microsoft.CodeAnalysis.CommandLine.DesktopBuildClient.GetBasePipeName(String compilerExeDirectory)
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.VisualBasic.Core.targets(56,5): error : at Microsoft.CodeAnalysis.CommandLine.DesktopBuildClient.GetPipeNameForPath(String compilerExeDirectory)
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.VisualBasic.Core.targets(56,5): error : at Microsoft.CodeAnalysis.CommandLine.DesktopBuildClient.RunServerCompilation(RequestLanguage language, List`1 arguments, BuildPaths buildPaths, String keepAlive, String libEnvVariable, CancellationToken cancellationToken)
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.VisualBasic.Core.targets(56,5): error : at Microsoft.CodeAnalysis.BuildTasks.ManagedCompiler.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
我在WinForm,Console和其他项目类型中遇到了这个构建错误。
当我加载任何解决方案时,我收到错误“VSPackage包未正确加载。”。如果我创建一个新的解决方案,我也无法构建。
我检查了xml文件,但没有解决如何解决这个问题。
ActivityLog.xml errors (full file on pastbin)
我重新安装Visual Studio并创建一个基本的hello控制台也可以进行故障排除。
Module ModuleTest
Sub Main()
Console.WriteLine("hello")
Console.ReadKey()
End Sub
End Module
devenv flags不做任何改变
Microsoft Windows [版本6.2.9200] (c)2012 Microsoft Corporation。 Todos os direitos reservados。
C:\用户\ ppolonia> F:
F:> cd F:\ Programas(x86)\ Microsoft Visual Studio 14.0 \ Common7 \ IDE
F:\ Programas(x86)\ Microsoft Visual Studio 14.0 \ Common7 \ IDE> devenv /安全模式
F:\ Programas(x86)\ Microsoft Visual Studio 14.0 \ Common7 \ IDE>
我正在使用Windows 8 64位。 Bellow是Visual Studio信息:
Microsoft Visual Studio社区2015版本14.0.25123.00更新2 Microsoft .NET Framework版本4.6.01055
已安装版本:社区
Visual Basic 2015 00322-20000-00000-AA322 Microsoft Visual Basic 2015
Visual C#2015 00322-20000-00000-AA322 Microsoft Visual C#2015
Visual C ++ 2015 00322-20000-00000-AA322 Microsoft Visual C ++ 2015
Visual Studio包5.205.60510.1的Application Insights工具 Visual Studio的应用程序洞察工具
ASP.NET和Web Tools 2015.1(Beta8)14.1.11106.0 ASP.NET和Web 工具2015.1(Beta8)
ASP.NET Web框架和工具2012.2 4.1.41102.0另外 信息,请访问http://go.microsoft.com/fwlink/?LinkID=309563
ASP.NET Web框架和工具2013 5.2.40314.0有关其他信息 信息,请访问http://www.asp.net/
Common Azure Tools 1.7提供Azure使用的常用服务 移动服务和Microsoft Azure工具。
GitHub.VisualStudio 1.0一个带来的Visual Studio扩展 GitHub流入Visual Studio。
Microsoft Azure移动服务工具1.4 Microsoft Azure Mobile 服务工具
PreEmptive Analytics Visualizer 1.2 Microsoft Visual Studio 扩展以可视化PreEmptive中的汇总摘要 分析产品。
SQL Server数据工具14.0.60311.1 Microsoft SQL Server数据工具
TypeScript 1.8.29.0 Visual Studio的TypeScript工具
Web Essentials 2015.2 2.0.214为Visual添加了许多有用的功能 面向Web开发人员的Studio。需要Visual Studio 2015
Bellow是系统信息(用葡萄牙语,我的当地语言):
Relatóriodasinformaçõesdosistema escritas em:06/05/16 16:19:58 Nome de sistema:MAXTOR8DEVPT [Resumo do sistema]
项目Valor Nome执行Microsoft Microsoft Windows 8企业版本6.2.9200 Compilação9200OutradescriçãodoOndisponívelFabricantedo 所以微软公司Nome做sistema MAXTOR8DEVPT Fabricante做 sistema技嘉科技有限公司Modelo do sistema Z87X-D3H
Tipo do sistema基于x64的PC Sistema SKU由O.E.M.填写 Processador Intel(R)Core(TM)i7-4770 CPU @ 3.40GHz,3392 Mhz,4 Núcleo(s),8 Processador(es)Lógico(s)Data /versãodeBIOS American Megatrends Inc. F7,02 / 08 /2013VersãoMMBIOS2.7Versãodo Controlador Incorporado 255.255 Modo de BIOS Legado Fabricante da Placa Base技嘉科技有限公司Modelo da Placa BaseIndisponívelNomeda Placa Base PlacaBaseFunçãoda Plataforma Ambiente de Trabalho Estado de ArranqueSeguroNão suportadoConfiguraçãoPCR7IndisponívelDiretóriodo Windows C:\WindowsDiretóriodosistema C:\ Windows \ system32 Dispositivo de arranque \ Device \HarddiskVolume1RegiãoPortugal
Camadadeabstraçãodehardware(HAL)Versão=“6.2.9200.16442”Nome de utilizador Maxtor8DevPT \ ppoloniaFusohorárioHoraPadrãodeGMT
MemóriaFísica(RAM)Instalada 16,0GBMemóriifísica总计15,9 GB Memóriifísicadisponível3,16GBMemória虚拟总计25,0 GB Memóriavirtualdisponível7,48GBEspaçodeficheirodepágina9,14 GB FicheirodepaginaçãoF:\ pagefile.sys Foi detetado um hipervisor。 作为功能必需品,必须使用Hyper-Vnãoserãoapresentadas。
答案 0 :(得分:2)
您的工作站在Windows中启用了FIPS策略,这将导致许多加密和散列算法在使用时失败。它可以防止在银行和军事环境中使用不安全的加密技术。不幸的是,在构建Visual Basic时,这似乎打破了MsBuild(并且XAML也存在已知问题)。
要解决此问题,您需要编辑MsBuild.exe.config以获取您正在调用的MsBuild版本(可能是%Programfiles(x86)%\Msbuild\14.0\bin
中的那个)。
添加:
<configuration>
<runtime>
...
<!-- below tag will disable security policy checking for FIPS -->
<enforceFIPSPolicy enabled="false"/>
...
</runtime>
</configuration>
more information on the impact of FIPS, read the KB Article about its effects。
你可能需要为devenv.exe.config做同样的事情,可以在%DevEnvDir%
的任何Visual Studio命令提示符下找到你遇到问题的版本。