我在peverify
.dll 的发布版本上运行,它给了我错误“堆栈深度因路径而异”:
[IL]: Error: [C:\tfs\EcoSys\SCM\NextGenInstaller\Cmc.Installer\Cmc.Installer.Desktop\bin\Release\Cmc.Installer.Modules.Crm.dll : Cmc.Installer.Modules.Crm.Models.DatabaseInfo::set_Action][offset 0x0000007F] Stack depth differs depending on path.
1 Error(s) Verifying C:\tfs\EcoSys\SCM\NextGenInstaller\Cmc.Installer\Cmc.Installer.Desktop\bin\Release\Cmc.Installer.Modules.Crm.dll
的代码set_Action
如下:
public InstallerAction Action
{
get { return _action; }
set
{
_action = value;
InstallMainServer = false;
InstallDistributorServer = false;
InstallAnalyticsServer = false;
InstallMediaServer = false;
InstallWebTrakServer = false;
switch (DatabaseType)
{
case DatabaseType.Main:
InstallMainServer = (Action == InstallerAction.Install);
break;
case DatabaseType.Distributor:
InstallDistributorServer = (Action == InstallerAction.Install);
break;
case DatabaseType.Analytics:
InstallAnalyticsServer = (Action == InstallerAction.Install);
break;
case DatabaseType.Media:
InstallMediaServer = (Action == InstallerAction.Install);
break;
case DatabaseType.WebTrak:
InstallWebTrakServer = (Action == InstallerAction.Install);
break;
default:
throw new ArgumentOutOfRangeException("DatabaseType");
}
}
}
我不知道为什么这个错误只发生在发布版本中。