deploy/undeploy difficulties

Topics: User Forum
Dec 22, 2006 at 10:47 AM
Hello,

I'm trying to deploy/undeploy mssqlspatial in sqlserver2005express edition.
I use two workstations, both on the same domain.
One with visual studio2005+sqlserver2005 native client (dellxpdavidh), one with SQL SERVER Exp edition (dellxpdavidh2). I've used (so far) the same domain user account to log on both workstations.
firewall has been set up to allow port 1253 on the 'server' workstation (if I may call it so)
I use windows authentification to log to sqlserver
ping works fine, as well as telnet (with 1253 port)

The server is called : SQLEXPOLDJONAT, and the only activ protocol is TCP/IP
remote access is allowed.
SQLServer Service for this server runs as a local system account (that's the only way I found to have a SPN which is called MSSQLSvc/dellxpdavidh2.arcadeconseil.fr:1253 )

Visual Studio itself has no problem to access the server, to show me the tables, to launch some basic queries, etc...(but it could do so even when I had no SPN an no access rights from dellxpdavidh to dellxpdavidh2 so it doesn't prove anything....only that I wonder how it does that...but that's not the point !)

Nevertheless, despite all these efforts, guess what....can't deploy/undeploy from the 'client' workstation (dellxpdavidh), it works only from the 'server' workstation (dellxpdavidh2).
The error message is (I only translated the beginning of the message):

M:\src\MsSqlSpatialConsole\bin\Debug>msscmd -undeploy -server=dellxpdavidh2\sqlexpoldjonat -db=TESTSPATIAL

An unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib.dll.
Additional information: Request for the permission of type System.Security.Permissions.EnvironmentPermission, mscorlib, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
à System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
à System.Security.PermissionSet.Demand()
à System.Data.Common.DbConnectionOptions.DemandPermission()
à System.Data.SqlClient.SqlConnection.PermissionDemand()
à System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection)
à System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
à System.Data.SqlClient.SqlConnection.Open()
à Deployment.UndeployAssembly(String assemblyFilename, String connectionString)
à MsSqlSpatialConsole.Program.UndeployAssembly(String connectionString)
à MsSqlSpatialConsole.Program.Main(String[] args)
L'action qui a échoué était :
Demand
Le type de la première autorisation qui a échoué était :
System.Data.SqlClient.SqlClientPermission
La première autorisation qui a échoué était :
<IPermission class="System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
AllowBlankPassword="False">
<add ConnectionString="Data Source=dellxpdavidh22\sqlexpoldjonat;Initial Catalog=TESTSPATIAL;Integrated Security=SSPI;"
KeyRestrictions=""
KeyRestrictionBehavior="AllowOnly"/>
</IPermission>

La demande était pour :
<PermissionSet class="System.Security.PermissionSet"
version="1">
<IPermission class="System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
AllowBlankPassword="False">
<add ConnectionString="Data Source=dellxpdavidh22\sqlexpoldjonat;Initial Catalog=TESTSPATIAL;Integrated Security=SSPI;"
KeyRestrictions=""
KeyRestrictionBehavior="AllowOnly"/>
</IPermission>
</PermissionSet>

Le jeu autorisé de l'assembly défaillant était :
<PermissionSet class="System.Security.PermissionSet"
version="1">
<IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Read="USERNAME"/>
<IPermission class="System.Security.Permissions.FileDialogPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Read="M:\src\MsSqlSpatialConsole\bin\Debug\"
PathDiscovery="M:\src\MsSqlSpatialConsole\bin\Debug\"/>
<IPermission class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Allowed="AssemblyIsolationByUser"
UserQuota="9223372036854775807"
Expiry="9223372036854775807"
Permanent="True"/>
<IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Flags="ReflectionEmit"/>
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Flags="Assertion, Execution, BindingRedirects"/>
<IPermission class="System.Security.Permissions.UIPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission class="System.Security.Permissions.UrlIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Url="file:///M:/src/MsSqlSpatialConsole/bin/Debug/msscmd.exe"/>
<IPermission class="System.Security.Permissions.ZoneIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Zone="Intranet"/>
<IPermission class="System.Net.DnsPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission class="System.Drawing.Printing.PrintingPermission, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
version="1"
Level="DefaultPrinting"/>
</PermissionSet>

L'assembly ou le AppDomain qui a échoué était :
msscmd, Version=0.1.2545.27541, Culture=neutral, PublicKeyToken=null
La méthode qui a causé l'échec était :
Void UndeployAssembly(System.String, System.String)
La zone de l'assembly qui a échoué était :
Intranet
L'URL de l'assembly qui a échoué était :
file:///M:/src/MsSqlSpatialConsole/bin/Debug/msscmd.exe

Microsoft (http://support.microsoft.com/kb/814741/en) suggests to use System.Environment.UserName instead of SystemInformation.UserName....Don't know exactly what that means....

If someone could give me a clue...

Thanks

David HILPIPRE