All*_*lls 4 .net vb.net deployment clickonce visual-studio
今天我开始每次用户尝试安装应用程序时都会收到错误,我不知道为什么我在部署0个月的问题后得到这个,我没有改变任何与项目属性相关的内容,所有的修改都与代码有关.
这是错误日志
平台版本信息Windows:10.0.15063.0(Win32NT)公共语言运行时:4.0.30319.42000 System.Deployment.dll:4.7.2046.0内建者:NET47REL1 clr.dll:4.7.2101.1内建者:NET47REL1LAST dfdll.dll:4.7.2046.0内置作者:NET47REL1 dfshim.dll:10.0.15063.0(WinBuild.160101.0800)
来源部署网址:file:/// Y:/RE/RentaEquipos.application部署提供商网址:file://svrre/Repository/RE/RentaEquipos.application应用程序网址:file:// svrre /存储库/ RE /应用程序%20文件/RentaEquipos_2017_07_10_8/RentaEquipos.exe.manifest
IDENTITIES部署标识:RentaEquipos.application,版本= 2017.7.10.8,Culture = es-CR,PublicKeyToken = 0000000000000000,processorArchitecture = x86
应用摘要*可安装的应用程序.
错误摘要以下是错误的摘要,这些错误的详细信息将在后面的日志中列出.*激活Y:\ RE\RentaEquipos.application导致异常.检测到以下失败消息:+指定的强制转换无效.
组件存储事务故障摘要未检测到事务错误.
警告*此应用程序的清单没有签名.签名验证将被忽略.*此应用程序的清单没有签名.签名验证将被忽略.*此应用程序的清单没有签名.签名验证将被忽略.
操作进度状态*[26/7/2017 11:23:16]:Y:\ RE\RentaEquipos.application的激活已经开始.*[26/7/2017 11:23:16]:部署清单的处理已成功完成.*[26/7/2017 11:23:16]:应用程序的安装已经开始.
错误详细信息在此操作期间检测到以下错误.*[26/7/2017 11:23:16] System.InvalidCastException - 指定的强制转换无效. - 来源:System.Deployment - 堆栈跟踪:System.Deployment.Application.DownloadManager.VerifyRequestedPrivilegesSupport(String requestedExecutionLevel)在System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest,String targetDir,Uri deploymentUri,> IDownloadNotification notification,DownloadOptions options)系统上的System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState&subState,ActivationDescription actDesc)上的System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState,ActivationDescription actDesc,Int64 transactionId,> TempDirectory&downloadTemp)中的,Uri&appSourceUri,String&appManifestPath)在Sy的.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri,Boolean isShortcut,String textualSubId,String> deploymentProviderUrlFromExtension,BrowserSettings browserSettings,String&errorPageUrl,Uri&deploymentUri)stem.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri,Boolean isShortcut,String textualSubId,String> deploymentProviderUrlFromExtension,BrowserSettings browserSettings,String&errorPageUrl)---从抛出异常的上一个位置开始的堆栈跟踪---在System.Runtime System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object)中的System.Deployment.Application.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri,Boolean isShortcut,String textualSubId,String> deploymentProviderUrlFromExtension,BrowserSettings browserSettings,String&errorPageUrl)中的.ExceptionServices.ExceptionDispatchInfo.Throw()州)
COMPONENT STORE TRANSACTION DETAILS没有可用的交易信息.
该DownloadManager.VerifyRequestedPrivilegesSupport方法被抛出InvalidCastException.不幸的是,该类的代码是不可用的ReferenceSource,但是当System.Deployment.dll被反编译,罪魁祸首是明确的.反编译的方法如下所示:
private static void VerifyRequestedPrivilegesSupport(string requestedExecutionLevel)
{
Logger.AddMethodCall("VerifyRequestedPrivilegesSupport(" + requestedExecutionLevel + ") called.");
if (!PlatformSpecific.OnVistaOrAbove)
return;
bool flag = false;
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System");
if (registryKey != null && registryKey.GetValue("EnableLUA") != null)
{
Logger.AddInternalState("LUA policy key = " + registryKey.Name);
if ((int) registryKey.GetValue("EnableLUA") != 0)
{
flag = true;
Logger.AddInternalState("LUA is enabled.");
}
}
if (flag && (string.Compare(requestedExecutionLevel, "requireAdministrator", StringComparison.OrdinalIgnoreCase) == 0 || string.Compare(requestedExecutionLevel, "highestAvailable", StringComparison.OrdinalIgnoreCase) == 0))
throw new InvalidDeploymentException(ExceptionTypes.UnsupportedElevetaionRequest, string.Format((IFormatProvider) CultureInfo.CurrentUICulture, Resources.GetString("Ex_ManifestExecutionLevelNotSupported"), new object[0]));
}
Run Code Online (Sandbox Code Playgroud)
抛出异常的行将是这样的:
if ((int) registryKey.GetValue("EnableLUA") != 0)
Run Code Online (Sandbox Code Playgroud)
该代码\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersio??n\Policies\System从Windows注册表中读取注册表项.为了抛出该异常,密钥必须存在且必须具有EnableLUA值,但该值必须键入除整数之外的值.您需要RegEdit.exe在收到错误的计算机上运行,导航到注册表中的该键,然后检查该值以查看它是什么.它应该REG_DWORD在Type列中显示该值.如果没有,请将其删除并使用正确的类型重新添加.
| 归档时间: |
|
| 查看次数: |
889 次 |
| 最近记录: |