简体   繁体   English

从文件共享运行时出现错误26

[英]Error 26 when running from a file share

When I run an application from a file share and it tries to connect to the specified SQL database, I get an error 26 (error locating server/instance). 当我从文件共享运行应用程序并尝试连接到指定的SQL数据库时,出现错误26(查找服务器/实例错误)。 If I run the application from a local drive it works. 如果我从本地驱动器运行该应用程序,则它将起作用。 Other people can run the application (and it works correctly) from the same file share while remoted into the same server, so there is obviously some kind of permission issue going on -- but I can't figure out what. 其他人可以在远程访问同一服务器的同时从同一文件共享运行该应用程序(并且可以正常运行),因此显然存在某种权限问题-但我不知道是什么。 Why would a .Net application be denied access to SQL server when started from a file share, but not when started from a local disk drive? 为什么从文件共享启动而不是从本地磁盘驱动器启动时,拒绝.Net应用程序访问SQL Server? And what security privilege is necessary in order to allow it to run from the shared drive? 为了使它能够从共享驱动器运行,需要什么安全特权?

Prior to .NET 4 Code Access Security caused an application that was run from a share in way that caused it to be not fully trusted. 在.NET 4之前,Code Access Security导致应用程序从共享中运行,从而导致该应用程序不被完全信任。 On of the permissions that would be denied (by default ) is being an SQL Server client. SQL Server客户端是默认情况下被拒绝的权限之一。

My guess is you are running into this issue. 我的猜测是您遇到了这个问题。

This article give a nice introduction and historical overview on how CAS changed 本文对CAS的变化方式进行了很好的介绍和历史概述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM