SQLClientPermission problem
- From: NuttingCDEF <Nutting.CDEF@xxxxxxxxx>
- Date: Sun, 14 Oct 2007 03:55:57 -0700
This is driving me dotty . . .
I have written some C# code that accesses a SQL Server database. I
have 2 machines. The database is on Machine 1. If I run my code on
Machine 1 it works fine. If I run my code on Machine 2, I get a
SqlClientPerrmission exception when opening the database connection.
The same connection string is used in each case specifying the machine
name on which the database is running explicitly (not using
localserver or (local)) - it also explicitly contains the UserID,
Password and Database. In each case, the code is physically stored in
the same place on Machine 1 which is accessed thorugh a network
share / mapped drive. The solution builds with no errors / no
warnings.
Configuration is both machines running Visual Studio Express 2005 with
SP1 applied (and Vista patch on machine 2). Both machines also
have .NET Framework 2.0 and the 2.0 SDK installed. Machine 1 is
running WinXPPro on 32-bit AMD processor. Machine 2 is running Vista
Home Premium x64 on 64-bit AMD processor. Both have 1GB RAM and ample
disc space. Machines are using wired LAN, not wireless, and
connectivity is fine for all other purposes. Network is peer to peer,
not a domain. Both machines use Norton Internet Security for anti-
virus / firewall and I am not aware of any problems with it and the
log files do not show any relevant traffic being blocked at either
end.
Both machines have SQL Server 2005 Express installed. Machine 1 has
TCP connectivity enabled over my LAN (but not from my internet
connection). I am using SQL Server authentication. I can connect to
SQL Server on Machine 1 from Machine 2 using SQL Server Management
Studio Express.
All Microsoft updates available have been applied to both machines.
The .exe assembly (the only assembly in the project / solution)
containing my code is signed with my strong name and the .NET 2.0
machine security.config has a code group to give Full Trust to
assemblies on my local intranet signed with my strong name. Using the
Evaluate Assembly tool on machine 2 in the .NET 2.0 Configuration
management console confirms that my .exe has Full Trust and that it is
recognising the assembly as residing on my local intranet and that it
has the strong key name. From machine 1, it says that it is in the My
Computer zone.
In Internet Options / Security / Local Intranet / Sites I have
disabled automatic detection of the local intranet and manually
enabled the 3 options in that dialog box. Without this, the Evaluate
Assembly on machine 2 thinks the assembly is located on the Internet
not my Local Intranet.
I also have .NET 1.1 and Visual Studio 2003 installed on both machines
and similar security settings in the .NET 1.1 machine.config.
What am I missing? Why does Full Trust not seem to give me
SqlClientPermission on machine 2?
The only other anomaly on machine 2 is that running the .NET 2.0
Configuration console from Administrative Tools on machine 2 is not
reliable - I have 2 Administrator logins - with one it works fine -
with the other I get a security exception and the console terminates.
Could this be related? Or is it a red herring? The behaviour of my
C# code described above is the same with either administrator login.
Many thanks for any assistance.
.
- Follow-Ups:
- Re: SQLClientPermission problem
- From: Dominick Baier
- Re: SQLClientPermission problem
- Prev by Date: Fuzz testing
- Next by Date: Re: SQLClientPermission problem
- Previous by thread: Fuzz testing
- Next by thread: Re: SQLClientPermission problem
- Index(es):
Relevant Pages
|
Loading