【发布时间】:2012-06-15 18:34:06
【问题描述】:
我们的一些新用户获得了全新的 Windows 7 PC,我不确定为什么在应用程序启动时出现以下错误。我们以管理员身份运行应用程序,但仍然抛出异常。谢谢!任何帮助表示赞赏!用户也是他们自己电脑的管理员。
'System.Data.SqlClient.SqlConnection' 的类型初始化程序引发了异常。 System.TypeInitializationException:“System.Data.SqlClient.SqlConnectionFactory”的类型初始化程序引发了异常。 ---> System.TypeInitializationException:“System.Data.SqlClient.SqlPerformanceCounters”的类型初始化程序引发了异常。 ---> System.IO.FileLoadException: 无法加载文件或程序集 'file:///C:\Users\\OMAIN\AppData\Local\Apps\2.0\7LMDR8E0.X2T\60X0DGVM.VVW\asce..tion_6bf0e6a67bb42923_0001 .0000_1a6b34a6368d30ed\Creation.exe' 或其依赖项之一。访问被拒绝。 在 System.Reflection.RuntimeAssembly._nLoad(AssemblyName 文件名,字符串代码库,证据 assemblySecurity,RuntimeAssembly locationHint,StackCrawlMark 和 stackMark,布尔 throwOnFileNotFound,布尔 forIntrospection,布尔suppressSecurityChecks) 在 System.Reflection.RuntimeAssembly.nLoad(AssemblyName 文件名,字符串 codeBase,证据 assemblySecurity,RuntimeAssembly locationHint,StackCrawlMark 和 stackMark,布尔 throwOnFileNotFound,布尔 forIntrospection,布尔suppressSecurityChecks) 在 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,证据 assemblySecurity,StackCrawlMark 和 stackMark,Boolean for Introspection,Boolean suppressSecurityChecks) 在 System.Reflection.RuntimeAssembly.InternalLoadFrom (字符串 assemblyFile,证据 securityEvidence,Byte [] hashValue,AssemblyHashAlgorithm hashAlgorithm,Boolean for Introspection,Boolean suppressSecurityChecks,StackCrawlMark 和 stackMark) 在 System.Reflection.Assembly.LoadFrom(字符串 assemblyFile) 在 System.Runtime.Hosting.ManifestRunner.get_EntryAssembly() 在 System.AppDomainManager.get_EntryAssembly() 在 System.Reflection.Assembly.GetEntryAssembly() 在 System.Data.ProviderBase.DbConnectionPoolCounters.GetAssemblyName() 在 System.Data.ProviderBase.DbConnectionPoolCounters.GetInstanceName() 在 System.Data.ProviderBase.DbConnectionPoolCounters..ctor(字符串 categoryName,字符串 categoryHelp) 在 System.Data.SqlClient.SqlPerformanceCounters..ctor() 在 System.Data.SqlClient.SqlPerformanceCounters..cctor() --- 内部异常堆栈跟踪结束 --- 在 System.Data.SqlClient.SqlConnectionFactory..cctor() --- 内部异常堆栈跟踪结束 --- 在 System.Data.SqlClient.SqlConnection..cctor()
【问题讨论】:
-
将您的应用程序设置为以管理员身份运行
-
我们以管理员身份运行它
-
你没有提到它,但确保程序是为 x86 而不是任何 CPU 编译的。
-
@LarsTech 是的,它的 x86 设置