Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/308.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ';System.Data.SqlClient.SqlConnection';在Windows 7中引发异常_C#_Windows 7 - Fatal编程技术网

C# ';System.Data.SqlClient.SqlConnection';在Windows 7中引发异常

C# ';System.Data.SqlClient.SqlConnection';在Windows 7中引发异常,c#,windows-7,C#,Windows 7,我们的一些新用户使用了全新的Windows7电脑,我不知道为什么在应用程序启动时会出现以下错误。我们以管理员身份运行应用程序,但仍然会引发异常。谢谢感谢您的帮助!用户也是自己电脑的管理员 The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception. System.TypeInitializationException: The type initializer for 'System.Data

我们的一些新用户使用了全新的Windows7电脑,我不知道为什么在应用程序启动时会出现以下错误。我们以管理员身份运行应用程序,但仍然会引发异常。谢谢感谢您的帮助!用户也是自己电脑的管理员

The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception. System.TypeInitializationException: The type initializer for 'System.Data.SqlClient.SqlConnectionFactory' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Data.SqlClient.SqlPerformanceCounters' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\\OMAIN\AppData\Local\Apps\2.0\7LMDR8E0.X2T\60X0DGVM.VVW\asce..tion_6bf0e6a67bb42923_0001.0000_1a6b34a6368d30ed\Creation.exe' or one of its dependencies. Access is denied. at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark) at System.Reflection.Assembly.LoadFrom(String assemblyFile) at System.Runtime.Hosting.ManifestRunner.get_EntryAssembly() at System.AppDomainManager.get_EntryAssembly() at System.Reflection.Assembly.GetEntryAssembly() at System.Data.ProviderBase.DbConnectionPoolCounters.GetAssemblyName() at System.Data.ProviderBase.DbConnectionPoolCounters.GetInstanceName() at System.Data.ProviderBase.DbConnectionPoolCounters..ctor(String categoryName, String categoryHelp) at System.Data.SqlClient.SqlPerformanceCounters..ctor() at System.Data.SqlClient.SqlPerformanceCounters..cctor() --- End of inner exception stack trace --- at System.Data.SqlClient.SqlConnectionFactory..cctor() --- End of inner exception stack trace --- at System.Data.SqlClient.SqlConnection..cctor() “System.Data.SqlClient.SqlConnection”的类型初始值设定项引发异常。 System.TypeInitializationException:“System.Data.SqlClient.SqlConnectionFactory”的类型初始值设定项引发异常。-->System.TypeInitializationException:“System.Data.SqlClient.SqlPerformanceCounters”的类型初始值设定项引发异常。-->System.IO.FileLoadException:无法加载文件或程序集的file:///C:\用户\\OMAIN\AppData\Local\Apps\2.0\7LMDR8E0.X2T\60X0DGVM.VVW\asce..tion_6bf0e6a67bb42923_0001.0000_1a6b34a6368d30ed\Creation.exe'或其依赖项之一。访问被拒绝。 在System.Reflection.RuntimeAssembly.\n加载(AssemblyName文件名、字符串代码基、证据assemblySecurity、RuntimeAssembly位置提示、StackScrawMark和stackMark、Boolean throwOnFileNotFound、Boolean For Inspection、Boolean suppressSecurityChecks) 位于System.Reflection.RuntimeAssembly.nLoad(AssemblyName文件名、字符串代码基、证据assemblySecurity、RuntimeAssemblyLocationHint、StackScrawlMark和stackMark、Boolean throwOnFileNotFound、Boolean For Inspection、Boolean suppressSecurityChecks) 位于System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,证据assemblySecurity,StackScrawMark&stackMark,布尔值用于内省,布尔值suppressSecurityChecks) 位于System.Reflection.RuntimeAssembly.InternalLoadFrom(字符串汇编文件、证据安全性证据、字节[]哈希值、AssemblyHashAlgorithm哈希算法、Boolean ForInspection、Boolean suppressSecurityChecks、StackScrawMark和stackMark) 位于System.Reflection.Assembly.LoadFrom(字符串汇编文件) 在System.Runtime.Hosting.ManifestRunner.get_EntryAssembly()中 在System.AppDomainManager.get\u EntryAssembly()中 在System.Reflection.Assembly.GetEntryAssembly()中 位于System.Data.ProviderBase.DbConnectionPoolCounters.GetAssemblyName()处 位于System.Data.ProviderBase.DbConnectionPoolCounters.GetInstanceName()处 位于System.Data.ProviderBase.DbConnectionPoolCounters..ctor(String categoryName,String categoryHelp) 位于System.Data.SqlClient.SqlPerformanceCounters..ctor()处 位于System.Data.SqlClient.SqlPerformanceCounters..cctor()处 ---内部异常堆栈跟踪的结束--- 位于System.Data.SqlClient.SqlConnectionFactory..cctor()处 ---内部异常堆栈跟踪的结束---
在System.Data.SqlClient.SqlConnection..cctor()中找到异常“creation.exe”中提到的文件并在其上运行。它可能会显示一个不在新计算机上的缺少的程序集或dll。

找到异常“creation.exe”中提到的文件并在其上运行。它可能会显示不在新计算机上的缺少的程序集或dll。

如果可以从浏览器访问该服务,请检查客户端端点行为配置,如下所示:


如果可以从浏览器访问服务,请检查客户端端点行为配置,如下所示:



将应用程序设置为以管理员身份运行我们将以管理员身份运行您没有提到它,但请确保该程序是为x86而不是任何CPU编译的。@LarsTech是为x86设置的将应用程序设置为以管理员身份运行我们将以管理员身份运行您没有提到它,但请确保该程序是为x86而不是任何CPU编译的。@LarsTech是为x86而设置的