什么导致运行程序时报TargetInvocationExeption与StrongName错误
有一个自己编的VB.NET程序,编译后生安装包。客户端双击安装包就可以将程序安装到本地。安装后,点击桌面上的图标就可以启动程序。
1. 90%的客户端能正常启动程序。
2. 8%的客户端在启动程序时,得到以下报错。
Error:Exception has been thrown by the target of invocation.
Exception Stack Trace:
System.Reflection.TargetInvocationException
at System.Runtime.Type.CreateInstanceImpl(Boolean, publicOnly)
at System.Activator.CreateInstance(Type Type, Boolean nonPublic)
at Vbb.Mtin.UI.Common.BaseStartup.Run(Type mainFromType, Boolean enforceSecurity)
3. 2%的客户端在启动程序时,得到以下报错。
Error: Request for the permission of type
System.Security.Permissions.StrongNameIdentityPermission, mscorlib,
Version=1.0.5000.0, Culture=neual, PublicKeyToken=?????? failed.
我查了很久都没有弄清楚导致这两个问题发生的原因,请大家帮助!第1个问题是不是与.net framwork的版本有关系?第2个是不是和注册表中的StrongName值有关系。多谢!