当前位置:  开发笔记 > 编程语言 > 正文

CS8078无法构建vSphere DLL:表达式太长或太复杂而无法编译

如何解决《CS8078无法构建vSphereDLL:表达式太长或太复杂而无法编译》经验,为你挑选了0个好方法。

我在此处按照文档进行设置以进行Microsoft C#开发,并在此步骤中构建C#vSphere DLL,在开发人员命令提示符中获得以下信息:

C:\Users\user\Downloads\VMware-vSphereSDK-6.5.0-4571253\SDK\vsphere-ws\dotnet\bin>build.bat
        1 file(s) copied.
Fixing HttpNfcLeaseInfo type, adding missing leaseState property
Generating VimService.cs
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.6.1055.0]
Copyright (c) Microsoft Corporation.  All rights reserved.

Generating files...
C:\Users\user\Downloads\VMware-vSphereSDK-6.5.0-4571253\SDK\vsphere-ws\dotnet\bin\VimService.cs
Compiling original VimService.dll
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.6.1055.0]
Copyright (c) Microsoft Corporation.  All rights reserved.

Generating XML serializers...
C:\Users\user\Downloads\VMware-vSphereSDK-6.5.0-4571253\SDK\vsphere-ws\dotnet\bin\VimServiceSerializers.cs
        1 file(s) copied.
Optimizing VimService.cs by stripping serializer hint attributes.
Compiling optimized VimService.dll
FAILED

查看build.bat它似乎在此行上失败:

echo Compiling optimized VimService.dll
csc /t:library /out:Vim25Service.dll VimService.cs VimServiceSerializers.cs >nul || goto ERROR

如果我csc /t:library /out:Vim25Service.dll VimService.cs VimServiceSerializers.cs手动运行,则会得到以下信息:

C:\Users\user\Downloads\VMware-vSphereSDK-6.5.0-4571253\SDK\vsphere-ws\dotnet\bin>csc /t:library /out:Vim25Service.dll VimService.cs VimServiceSerializers.cs
Microsoft (R) Visual C# Compiler version 1.3.1.60616
Copyright (C) Microsoft Corporation. All rights reserved.

VimServiceSerializers.cs(32548,98): error CS8078: An expression is too long or complex to compile

我也尝试过VS2017:

C:\Users\user\Downloads\VMware-vSphereSDK-6.5.0-4571253\SDK\vsphere-ws\dotnet\bin>csc /t:library /out:Vim25Service.dll VimService.cs VimServiceSerializers.cs
Microsoft (R) Visual C# Compiler version 2.0.0.61213
Copyright (C) Microsoft Corporation. All rights reserved.

VimServiceSerializers.cs(31372,109): error CS8078: An expression is too long or complex to compile

注意,VimServiceSerializers.cs(#####,##)行和列上的行为每次都不同。

Google搜寻错误CS8078,发现这是编译器堆栈空间不足的问题。/sf/ask/17360801/

如何成功编译VmWare的代码?

推荐阅读
我我檬檬我我186
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有