VB.NET 的 Visual Basic 2015 项目在 XP 中工作
Posted
技术标签:
【中文标题】VB.NET 的 Visual Basic 2015 项目在 XP 中工作【英文标题】:Visual Basic 2015 project for VB.NET to work in XP 【发布时间】:2016-12-02 13:33:49 【问题描述】:抱歉,因为我没有太多经验,所以缺乏知识。
我已经使用 Visual Basic 2015 创建了一个 VB.NET 应用程序,但是当我尝试在 XP Professional Version 2002 SP3 上运行该应用程序时,我收到以下错误消息。
我这辈子都不知道如何解决这个问题。创建应用程序的 .net 框架是 4.5.2。
该应用程序在 Windows 7 和 Windows 10 上完美运行。
但是,问题只在 XP 上
PLATFORM VERSION INFO
Windows : 5.1.2600.196608 (Win32NT)
Common Language Runtime : 4.0.30319.269
System.Deployment.dll : 4.0.30319.1 (RTMRel.030319-0100)
clr.dll : 4.0.30319.269 (RTMGDR.030319-2600)
dfdll.dll : 4.0.30319.1 (RTMRel.030319-0100)
dfshim.dll : 4.0.31106.0 (Main.031106-0000)
SOURCES
Deployment url : file:///C:/Documents%20and%20Settings/rwuser/Desktop/Disk%20Cleanup%20Toolkit/drive_cleanup.application
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\Documents and Settings\rwuser\Desktop\Disk Cleanup Toolkit\drive_cleanup.application resulted in exception. Following failure messages were detected:
+ Exception reading manifest from file:///C:/Documents%20and%20Settings/rwuser/Desktop/Disk%20Cleanup%20Toolkit/drive_cleanup.application: the manifest may not be valid or the file could not be opened.
+ Manifest XML signature is not valid.
+ SignatureDescription could not be created for the signature algorithm supplied.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [28/07/2016 09:56:20] : Activation of C:\Documents and Settings\rwuser\Desktop\Disk Cleanup Toolkit\drive_cleanup.application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [28/07/2016 09:56:21] System.Deployment.Application.InvalidDeploymentException (ManifestParse)
- Exception reading manifest from file:///C:/Documents%20and%20Settings/rwuser/Desktop/Disk%20Cleanup%20Toolkit/drive_cleanup.application: the manifest may not be valid or the file could not be opened.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirectBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Deployment.Application.InvalidDeploymentException (SignatureValidation)
- Manifest XML signature is not valid.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.Manifest.AssemblyManifest.ValidateSignature(Stream s)
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
--- Inner Exception ---
System.Security.Cryptography.CryptographicException
- SignatureDescription could not be created for the signature algorithm supplied.
- Source: System.Security
- Stack trace:
at System.Security.Cryptography.Xml.SignedXml.CheckSignedInfo(AsymmetricAlgorithm key)
at System.Security.Cryptography.Xml.SignedXml.CheckSignature(AsymmetricAlgorithm key)
at System.Security.Cryptography.Xml.SignedXml.CheckSignatureReturningKey(AsymmetricAlgorithm& signingKey)
at System.Deployment.Internal.CodeSigning.SignedCmiManifest.Verify(CmiManifestVerifyFlags verifyFlags)
at System.Deployment.Application.Manifest.AssemblyManifest.ValidateSignature(Stream s)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
【问题讨论】:
Windows XP 现已过时。最好不要考虑它。 我知道,但我工作的公司仍在使用 XP!大声笑。 【参考方案1】:XP 仅支持最高 4.0 版的 .NET Framework。如果你想在 XP 上运行它,你需要将目标框架更改为 4 并重新编译项目。
https://blogs.msdn.microsoft.com/dotnet/p/dotnet45xp/
【讨论】:
我这样做了,但经过多次玩弄后并没有解决问题。相反,在我的脚本上,我使用的是 WMI 查询,它实际上不适用于 XP .. 所以将 WIM 更改为系统管理搜索,然后它就可以工作了。以上是关于VB.NET 的 Visual Basic 2015 项目在 XP 中工作的主要内容,如果未能解决你的问题,请参考以下文章
在 Visual Basic VB.Net 2010 中使用 System.DateTime 类型作为可选参数
在visual basic(而不是VB.net)中创建一个错误弹出框