Showing posts with label msdn. Show all posts
Showing posts with label msdn. Show all posts

Friday, March 30, 2012

Personal Edition

I currently have a copy of SQL Server Enterprise Edition through MSDN
subscriptions. Everything I have read indicates that there should be a
Personal Edition of SQL Server on the same disk. I do not see this option
during the installation. I have also searched the individual files on the
disk with no success. Does anybody know where these files are located?I'm not totally sure but I think that the Personal Edition got installed
when you try to install the Standard Edition on an operating system which is
not a server edition, like WinXP.
Maybe it's the same thing with the Enterprise Edition but if you wan to play
the enterprise features like materialized views on a workstation, then you
should install the Developer Edition instead.
S. L.
"Phil" <Phil@.discussions.microsoft.com> wrote in message
news:C2524E60-6C99-4B88-9AD6-84301CAA3FD6@.microsoft.com...
>I currently have a copy of SQL Server Enterprise Edition through MSDN
> subscriptions. Everything I have read indicates that there should be a
> Personal Edition of SQL Server on the same disk. I do not see this option
> during the installation. I have also searched the individual files on the
> disk with no success. Does anybody know where these files are located?|||For SQL Server 2000 it is a separate CD. For 7.0, it was on the same CD.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Phil" <Phil@.discussions.microsoft.com> wrote in message
news:C2524E60-6C99-4B88-9AD6-84301CAA3FD6@.microsoft.com...
>I currently have a copy of SQL Server Enterprise Edition through MSDN
> subscriptions. Everything I have read indicates that there should be a
> Personal Edition of SQL Server on the same disk. I do not see this option
> during the installation. I have also searched the individual files on the
> disk with no success. Does anybody know where these files are located?|||Thanks for your help Tibor. I just located it on a seperate CD.
"Tibor Karaszi" wrote:
> For SQL Server 2000 it is a separate CD. For 7.0, it was on the same CD.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Phil" <Phil@.discussions.microsoft.com> wrote in message
> news:C2524E60-6C99-4B88-9AD6-84301CAA3FD6@.microsoft.com...
> >I currently have a copy of SQL Server Enterprise Edition through MSDN
> > subscriptions. Everything I have read indicates that there should be a
> > Personal Edition of SQL Server on the same disk. I do not see this option
> > during the installation. I have also searched the individual files on the
> > disk with no success. Does anybody know where these files are located?
>
>

Monday, March 12, 2012

Permissions

I posted a problem with connecting programmatically last week.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=590672&SiteID=1

Nobody seemed to have any suggestions, however since then, I've mucked things up and recovered to the same problem and now I've mucked things up again in a different way. Also last week I didn't mention that I was running my connection through remote desktop. That apparently can be a problem although not the fix.

I'm still getting the ServerVersion member status set to "'this.conn.ServerVersion' threw an exception of type 'System.InvalidOperationException' when I try to create a SqlConnection. I still don't understand why. But when I try to open the connection I now get the following exception

"Cannot open user default database. Login failed.\r\nLogin failed for user 'myserver\\ASPNET'."

which suggested permission problems. So using SQL Server Management Studio Express I opened my database and under properties selected "View server permissions" and the following message popped up.

TITLE: Microsoft SQL Server Management Studio Express

Cannot show requested dialog.


ADDITIONAL INFORMATION:

Could not load file or assembly 'file:///C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\SqlManagerUi.dll' or one of its dependencies. The system cannot find the file specified. (mscorlib)

There are no users listed under Permissions. I added guest permissions but it doesn't seem to make any difference. Since I'm running this under a web service, do I need to do something special?

Help

Cannot open user default database. Login failed.\r\nLogin failed for user 'myserver\\ASPNET'."

this error is trying to tell you there is an issue with the user's default database. ensure whatever account you are using to access your sqlserver has atleast public permissions.

In Mgmt. Studio/Object Explorer navigate to the Logins folder. Expand the folder and select the user you are attempting a client-side/ADO connection with. Select properties on the login and then select the "user mapping" tab. Check the public role for the user's assigned default database.

|||

Derek

Thanks for replying. Although not new to programmatically using databases I'm new to using sql server and not being familiar with it's terminology leaves me scratching my head while I try and hunt down what the error messages mean.

I've tried using both integrated security and adding my own user with a password. I know I'm probably missing something fundamental and thought maybe you had just given me the key. Unfortunately it doesn't appear to be the complete answer.

|||if you dont care about how you connect, for simplication purposes use sql authentication in your client code. create the account in sql server assign it's default database and ensure the sql account has atleast public (read) permission to that database.|||

Derek

I don't care at the moment how I connect. I would just like to see it connect.

I had already tried sql authentication before without success. After your response I tried again, messing with the connection string. No success.

|||is sql authentication enabled?|||

Derek

In SQL Server Management under Logins I've added a user called pubsub, set his login to SQL Server authentication and set his password. Then under User Mappings I made sure that public, reader, writer were checked.

In my application I used the following connection string,

"Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\WebServicesDemo\\PubSub\\App_Data\\PubSubDB.mdf;Database=PubSubDB;User ID=pubsub;Password=pspwd; Integrated Security=False;User Instance=True"

The connection error I get is

Login failed for user 'pubsub'. The user is not associated with a trusted SQL Server connection.|||you can run this code

USE [master]

GO

EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2

GO

or simply enable sql authentication via the GUI/Mgmt. Studio. and restart the server after making the change.

|||

Derek

I found the place in the gui under Server properties where I was able to set Server authentication to SQL Server. I then restarted SQL Server. The response I now get from a connection attempt is

Failed to generate a user instance of SQL Server. Only an integrated connection can generate a user instance. The connection will be closed.

Another interesting piece to this puzzle. My test setup involves a web application that makes a call to a web service. For simplification I moved the code to open the database to the web application using Windows authentication. It worked. I took the same code back to my web service and it doesn't work. What does that suggest? I tried that again with the current setup and received the same error above.

|||

Sorry, I hit the submit button to soon. I also meant to tell you that when I set Integrated Security=true, the connection in the web application works. When I set Integrated Security=true in the web service I get the following error

Unable to open the physical file \"C:\\WebServicesDemo\\PubSub\\App_Data\\PubSubDB.mdf\". Operating system error 5: \"5(Access is denied.)\".\r\nCould not attach file 'C:\\WebServicesDemo\\PubSub\\App_Data\\PubSubDB.mdf' as database 'PubSubDB'.

|||

Derek

Some more information. I noticed that although I've supposedly enabled SQL Server authentication (mixed mode), the connection properties Authentication method still show Windows Authentication. I tried to issue your registry change from sqlcmd and received

RegCreateKeyEx() returned error 5, 'Access is denied.'

So I created the key and value manually. It didn't change the connection property Authentication method which still showed Windows Authentication.

Everything I've try seems to work in the web application, but not in the Web Service. In the Web Service, I still received the "Unable to open the physical file" error.

|||

Derek

If your still following this I solved my problem. Although I knew it wouldn't be an acceptable final answer I decided as another data point to set impersonation in the web service web.config file using my personal login information. That worked, which confirmed to me the problem definitely had to do with the permissions of the web service account (I don't alway trust error messages).

So then I looked again at the account information to the database file itself. When I created the database using Visual Studio, VS put the database in the web services data directory and created a weird sqlexpress account (SQLServer2005MSSQLUser$WD49832$SQLEXPRESS (WD49832\SQLServer2005MSSQLUser$WD49832$SQLEXPRESS)) which I had just accepted managed VS's access to the database. Well I shouldn't trust MS to be so kind. I still don't know the purpose of that account but it obviously doesn't handle the application's access. Once I added the users group to the database file and gave them the necessary permissions it worked. I'm going to claim that there were just to many things I didn't understand in the beginning so I stepped into accepting bad assumptions. The upside I've learned more than I would had it been easy.

Thanks for your company and help while I struggled through that one.

|||your welcome and to be honest you taught me that "user instances" something I never use YET have to be used in conjunction with Integrated (windows) authentication. (which makes sense)

Permissions

I posted a problem with connecting programmatically last week.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=590672&SiteID=1

Nobody seemed to have any suggestions, however since then, I've mucked things up and recovered to the same problem and now I've mucked things up again in a different way. Also last week I didn't mention that I was running my connection through remote desktop. That apparently can be a problem although not the fix.

I'm still getting the ServerVersion member status set to "'this.conn.ServerVersion' threw an exception of type 'System.InvalidOperationException' when I try to create a SqlConnection. I still don't understand why. But when I try to open the connection I now get the following exception

"Cannot open user default database. Login failed.\r\nLogin failed for user 'myserver\\ASPNET'."

which suggested permission problems. So using SQL Server Management Studio Express I opened my database and under properties selected "View server permissions" and the following message popped up.

TITLE: Microsoft SQL Server Management Studio Express

Cannot show requested dialog.


ADDITIONAL INFORMATION:

Could not load file or assembly 'file:///C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\SqlManagerUi.dll' or one of its dependencies. The system cannot find the file specified. (mscorlib)

There are no users listed under Permissions. I added guest permissions but it doesn't seem to make any difference. Since I'm running this under a web service, do I need to do something special?

Help

Cannot open user default database. Login failed.\r\nLogin failed for user 'myserver\\ASPNET'."

this error is trying to tell you there is an issue with the user's default database. ensure whatever account you are using to access your sqlserver has atleast public permissions.

In Mgmt. Studio/Object Explorer navigate to the Logins folder. Expand the folder and select the user you are attempting a client-side/ADO connection with. Select properties on the login and then select the "user mapping" tab. Check the public role for the user's assigned default database.

|||

Derek

Thanks for replying. Although not new to programmatically using databases I'm new to using sql server and not being familiar with it's terminology leaves me scratching my head while I try and hunt down what the error messages mean.

I've tried using both integrated security and adding my own user with a password. I know I'm probably missing something fundamental and thought maybe you had just given me the key. Unfortunately it doesn't appear to be the complete answer.

|||if you dont care about how you connect, for simplication purposes use sql authentication in your client code. create the account in sql server assign it's default database and ensure the sql account has atleast public (read) permission to that database.|||

Derek

I don't care at the moment how I connect. I would just like to see it connect.

I had already tried sql authentication before without success. After your response I tried again, messing with the connection string. No success.

|||is sql authentication enabled?|||

Derek

In SQL Server Management under Logins I've added a user called pubsub, set his login to SQL Server authentication and set his password. Then under User Mappings I made sure that public, reader, writer were checked.

In my application I used the following connection string,

"Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\WebServicesDemo\\PubSub\\App_Data\\PubSubDB.mdf;Database=PubSubDB;User ID=pubsub;Password=pspwd; Integrated Security=False;User Instance=True"

The connection error I get is

Login failed for user 'pubsub'. The user is not associated with a trusted SQL Server connection.|||you can run this code

USE [master]

GO

EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2

GO

or simply enable sql authentication via the GUI/Mgmt. Studio. and restart the server after making the change.

|||

Derek

I found the place in the gui under Server properties where I was able to set Server authentication to SQL Server. I then restarted SQL Server. The response I now get from a connection attempt is

Failed to generate a user instance of SQL Server. Only an integrated connection can generate a user instance. The connection will be closed.

Another interesting piece to this puzzle. My test setup involves a web application that makes a call to a web service. For simplification I moved the code to open the database to the web application using Windows authentication. It worked. I took the same code back to my web service and it doesn't work. What does that suggest? I tried that again with the current setup and received the same error above.

|||

Sorry, I hit the submit button to soon. I also meant to tell you that when I set Integrated Security=true, the connection in the web application works. When I set Integrated Security=true in the web service I get the following error

Unable to open the physical file \"C:\\WebServicesDemo\\PubSub\\App_Data\\PubSubDB.mdf\". Operating system error 5: \"5(Access is denied.)\".\r\nCould not attach file 'C:\\WebServicesDemo\\PubSub\\App_Data\\PubSubDB.mdf' as database 'PubSubDB'.

|||

Derek

Some more information. I noticed that although I've supposedly enabled SQL Server authentication (mixed mode), the connection properties Authentication method still show Windows Authentication. I tried to issue your registry change from sqlcmd and received

RegCreateKeyEx() returned error 5, 'Access is denied.'

So I created the key and value manually. It didn't change the connection property Authentication method which still showed Windows Authentication.

Everything I've try seems to work in the web application, but not in the Web Service. In the Web Service, I still received the "Unable to open the physical file" error.

|||

Derek

If your still following this I solved my problem. Although I knew it wouldn't be an acceptable final answer I decided as another data point to set impersonation in the web service web.config file using my personal login information. That worked, which confirmed to me the problem definitely had to do with the permissions of the web service account (I don't alway trust error messages).

So then I looked again at the account information to the database file itself. When I created the database using Visual Studio, VS put the database in the web services data directory and created a weird sqlexpress account (SQLServer2005MSSQLUser$WD49832$SQLEXPRESS (WD49832\SQLServer2005MSSQLUser$WD49832$SQLEXPRESS)) which I had just accepted managed VS's access to the database. Well I shouldn't trust MS to be so kind. I still don't know the purpose of that account but it obviously doesn't handle the application's access. Once I added the users group to the database file and gave them the necessary permissions it worked. I'm going to claim that there were just to many things I didn't understand in the beginning so I stepped into accepting bad assumptions. The upside I've learned more than I would had it been easy.

Thanks for your company and help while I struggled through that one.

|||your welcome and to be honest you taught me that "user instances" something I never use YET have to be used in conjunction with Integrated (windows) authentication. (which makes sense)

Wednesday, March 7, 2012

Permission Reading Registry from Assembly

======== REPOSTED w/MSDN ALIAS ======== We have a custom assembly used by our reports that needs to access SQL
Server and the Registry. In code, prior to making our SQL server
connection, we assert the System.Data.SqlClient.SqlClientPermission and we
are able to connect just fine. Prior to opening the registry key, we assert
the System.Security.Permissions.RegistryPermission, but on the subsequent
call to open the subkey, we get the following exception:
Request for the permission of type
System.Security.Permissions.RegistryPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
* We created a code group in the policy config file giving our assembly full
trust.
* The Everyone group has permissions to read the registry key and the value.
* We executed Sysinternal's registry monitor tool and it doesn't appear to
even log the call to open the key.
Environment: Visual Studio.NET 1.1, Reporting Services 1.1, Windows XP
====[BEGIN CODE SNIPPET]============== RegistryKey regTest = null;
try {
RegistryPermission regPermission = new
RegistryPermission(RegistryPermissionAccess.Read,
"HKEY_LOCAL_MACHINE\\SOFTWARE\\0");
regPermission.Assert();
regTest = Registry.LocalMachine;
regTest = regTest.OpenSubKey("SOFTWARE"); // This call fails with the
exception above
return (string)regTest.GetValue("TestVal");
} finally {
if (regTest != null) {
regTest.Close();
}
}
====[END CODE SNIPPET]==============
I don't think this is a registry permission issue since it says the
"request" for the permission failed. However, I would have expected the
request to fail on the assert, not on the subsequent OpenSubKey call.
Does anyone have any suggestions on how to troubleshoot this?
Thanks,
ChrisHi Chris,
Thank you for posting.
Regarding on the SSRS custom assembly registry accessing issue, I think we
should still troubleshoot from the permission setting. And what we can
check is the below things:
1. raw win32 registry access permission
2. .NET CAS permission setting.
For win32 registry access permission, the regmon tool should be able to
capture the failure error
For .NET CAS permission problem, you can consider temporarly turn off the
.net framework's CAS setting through the caspol.exe tool:
#Code Access Security Policy Tool (Caspol.exe) (.NET Framework)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/htm
l/cpgrfcodeaccesssecuritypolicyutilitycaspolexe.asp
After turn off the CAS and test the custom assembly again to see whether it
works.
Hope this helps.
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||I have copied code out of the help file that opens the LocalMachine key and
calls GetSubKeys(). This fails with the same permissions error. I have
granted the Everyone group Full Control on the LocalMachine key. Using the
caspol.exe tool noted below, I have turned off CAS.
I have been running registry monitor from system internals, and unless I'm
using the tool incorrectly, I don't see any failures or successes. I am
using the RSReportHost to be able to execute the report and step through my
assembly. I don't know what process it would be using to access the
registry.
In regards to the suggestions below:
1. What other pemissions could I add in addition to granting the Everyone
group Full Control? I am still getting the exception.
2. As stated above, I executed the caspol.exe turning off CAS. I am still
getting the exception.
- Chris
=================================Taken from the Registry.LocalMachine field help file sample:
public static string PrintKeys() {
StringBuilder sbResult = new StringBuilder();
RegistryKey rk = Registry.LocalMachine;
// Retrieve all the subkeys for the specified key.
String [] names;
try {
names = rk.GetSubKeyNames(); <=== BOOM
} catch (Exception e) {
return e.Message;
}
int icount = 0;
// Print the contents of the array to the console.
foreach (String s in names) {
sbResult.Append(s);
// The following code puts a limit on the number
// of keys displayed. Comment it out to print the
// complete list.
icount++;
if (icount >= 10)
break;
}
return sbResult.ToString();
}
"Steven Cheng[MSFT]" <stcheng@.online.microsoft.com> wrote in message
news:eeLJoQfWGHA.932@.TK2MSFTNGXA01.phx.gbl...
> Hi Chris,
> Thank you for posting.
> Regarding on the SSRS custom assembly registry accessing issue, I think we
> should still troubleshoot from the permission setting. And what we can
> check is the below things:
> 1. raw win32 registry access permission
> 2. .NET CAS permission setting.
> For win32 registry access permission, the regmon tool should be able to
> capture the failure error
> For .NET CAS permission problem, you can consider temporarly turn off the
> net framework's CAS setting through the caspol.exe tool:
> #Code Access Security Policy Tool (Caspol.exe) (.NET Framework)
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/htm
> l/cpgrfcodeaccesssecuritypolicyutilitycaspolexe.asp
> After turn off the CAS and test the custom assembly again to see whether
> it
> works.
> Hope this helps.
> Regards,
> Steven Cheng
> Microsoft Online Community Support
>
> ==================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>|||Clarification - When running the RegMon tool, I do see a lot of activity
from other processes, but nothing that I can identify being associated with
my custom assembly.
"Chris Walls" <chwalls2@.community.nospam> wrote in message
news:OIlWD$WXGHA.3492@.TK2MSFTNGP05.phx.gbl...
>I have copied code out of the help file that opens the LocalMachine key and
>calls GetSubKeys(). This fails with the same permissions error. I have
>granted the Everyone group Full Control on the LocalMachine key. Using the
>caspol.exe tool noted below, I have turned off CAS.
> I have been running registry monitor from system internals, and unless I'm
> using the tool incorrectly, I don't see any failures or successes. I am
> using the RSReportHost to be able to execute the report and step through
> my assembly. I don't know what process it would be using to access the
> registry.
> In regards to the suggestions below:
> 1. What other pemissions could I add in addition to granting the Everyone
> group Full Control? I am still getting the exception.
> 2. As stated above, I executed the caspol.exe turning off CAS. I am still
> getting the exception.
> - Chris
> =================================> Taken from the Registry.LocalMachine field help file sample:
> public static string PrintKeys() {
> StringBuilder sbResult = new StringBuilder();
> RegistryKey rk = Registry.LocalMachine;
> // Retrieve all the subkeys for the specified key.
> String [] names;
> try {
> names = rk.GetSubKeyNames(); <=== BOOM
> } catch (Exception e) {
> return e.Message;
> }
> int icount = 0;
> // Print the contents of the array to the console.
> foreach (String s in names) {
> sbResult.Append(s);
> // The following code puts a limit on the number
> // of keys displayed. Comment it out to print the
> // complete list.
> icount++;
> if (icount >= 10)
> break;
> }
> return sbResult.ToString();
> }
>
> "Steven Cheng[MSFT]" <stcheng@.online.microsoft.com> wrote in message
> news:eeLJoQfWGHA.932@.TK2MSFTNGXA01.phx.gbl...
>> Hi Chris,
>> Thank you for posting.
>> Regarding on the SSRS custom assembly registry accessing issue, I think
>> we
>> should still troubleshoot from the permission setting. And what we can
>> check is the below things:
>> 1. raw win32 registry access permission
>> 2. .NET CAS permission setting.
>> For win32 registry access permission, the regmon tool should be able to
>> capture the failure error
>> For .NET CAS permission problem, you can consider temporarly turn off the
>> net framework's CAS setting through the caspol.exe tool:
>> #Code Access Security Policy Tool (Caspol.exe) (.NET Framework)
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/htm
>> l/cpgrfcodeaccesssecuritypolicyutilitycaspolexe.asp
>> After turn off the CAS and test the custom assembly again to see whether
>> it
>> works.
>> Hope this helps.
>> Regards,
>> Steven Cheng
>> Microsoft Online Community Support
>>
>> ==================================================>> When responding to posts, please "Reply to Group" via your newsreader so
>> that others may learn and benefit from your issue.
>> ==================================================>>
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> Get Secure! www.microsoft.com/security
>> (This posting is provided "AS IS", with no warranties, and confers no
>> rights.)
>|||Thanks for your followup Chris,
This seems strange, so far I can not consider any other particular security
related setting either. Should be a environment specific issue. Have you
tried creating a new custom assembly which access some certain registry to
see whether it also suffer the probelm on ths machine?
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.|||I got a little further. I created a new assembly that only had my registry
code. I ran it as a console application and it successfully read my
registry values. I saw in RegMon that the keys where opened, queried, etc.
I then changed it to a class library and referenced it with a test report.
I was receiving the same permission errors. I turned off security via the
caspol utility and then I was able to successfully read my values. I then
modified my test report to reference my first assembly and it too now works.
Clearly I didn't disable security the last time like I thought I did.
So cleary my entries in the rspreviewpolicy.config file is incorrect. I
thought I was granting full trust to my assembly. Here is my entries. They
are at the end of the file just before the </policy> end tag.
<CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust"
Name="TSIRegistryTest">
<IMembershipCondition
class="UrlMembershipCondition"
version="1" Url="C:\Program Files\Microsoft SQL Server\80\Tools\Report
Designer\ReportTest.dll" />
</CodeGroup>
Any help would be greatly appreciated.
- Chris
"Steven Cheng[MSFT]" <stcheng@.online.microsoft.com> wrote in message
news:N9KImB8XGHA.888@.TK2MSFTNGXA01.phx.gbl...
> Thanks for your followup Chris,
> This seems strange, so far I can not consider any other particular
> security
> related setting either. Should be a environment specific issue. Have you
> tried creating a new custom assembly which access some certain registry to
> see whether it also suffer the probelm on ths machine?
> Regards,
> Steven Cheng
> Microsoft Online Community Support
>
> ==================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>|||Thank you for the response Chris,
So your custom assembly is put in the following location:
C:\Program Files\Microsoft SQL Server\80\Tools\Report
Designer\ReportTest.dll
If so, I think the <CodeGroup > element you pasted should be ok. And the
problem is possibly caused by the location where you add the custom
<codeGroup> in the policy file. As you mentioend that you add it at the
end of the file just before the </policy> end tag. Do you mean that it is
not included/nested within other <codeGroup> ?, like below:
======================...other code group here
<!--
Your code group here?
-->
</PolicyLevel>
</policy>
</security>
</mscorlib>
</configuration>
==========================
If so, it is not the correct place since the codegroup in .NET code access
policy file is not a flat structure, they're hierarchical and nested...
And our custom code should be put within a "Local Computer"
firstMatchCodeGroup, it is as below:
================= <CodeGroup
class="FirstMatchCodeGroup"
version="1"
PermissionSetName="Execution"
Description="This code group grants
MyComputer code Execution permission. ">
<IMembershipCondition
class="ZoneMembershipCondition"
version="1"
Zone="MyComputer" />
<!--
many parallel nested sub codegroups here....
-->
</CodeGroup>
==============
You'll find there is many other sub codegroups nested inside it which are
parallel with each other. If you find it, you can try puting your custom
code group as the sub nested codegroup within it. In addition, you can
also try strong-named your assembly and put it in GAC, then use
strong-named membershipCondition to idenitify it for testing.
BTW, here is a good msdn article describing the code access security in
ASP.NET application(including customizing policy file):
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html
/paght000017.asp
Hope this also helps.
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Ok, I think I got it. One thing that was screwing me up is that the change
in the rspreviewpolicy.config was not being picked up by the RSReportHost
utility, even when I unloaded and reloaded it. Only when I started
previewing the report with VS.NET did I see a successful execution with CAS
turned on. Now I'm having similar issues on the build server, but I have a
better understanding of how to troubleshoot it.
Thanks for all of the help.
- Chris
"Steven Cheng[MSFT]" <stcheng@.online.microsoft.com> wrote in message
news:J8C4%23YEZGHA.6000@.TK2MSFTNGXA01.phx.gbl...
> Thank you for the response Chris,
> So your custom assembly is put in the following location:
> C:\Program Files\Microsoft SQL Server\80\Tools\Report
> Designer\ReportTest.dll
> If so, I think the <CodeGroup > element you pasted should be ok. And the
> problem is possibly caused by the location where you add the custom
> <codeGroup> in the policy file. As you mentioend that you add it at the
> end of the file just before the </policy> end tag. Do you mean that it is
> not included/nested within other <codeGroup> ?, like below:
> ======================> ...other code group here
> <!--
> Your code group here?
> -->
> </PolicyLevel>
> </policy>
> </security>
> </mscorlib>
> </configuration>
> ==========================> If so, it is not the correct place since the codegroup in .NET code access
> policy file is not a flat structure, they're hierarchical and nested...
> And our custom code should be put within a "Local Computer"
> firstMatchCodeGroup, it is as below:
> =================> <CodeGroup
> class="FirstMatchCodeGroup"
> version="1"
> PermissionSetName="Execution"
> Description="This code group grants
> MyComputer code Execution permission. ">
> <IMembershipCondition
> class="ZoneMembershipCondition"
> version="1"
> Zone="MyComputer" />
> <!--
> many parallel nested sub codegroups here....
> -->
> </CodeGroup>
> ==============> You'll find there is many other sub codegroups nested inside it which are
> parallel with each other. If you find it, you can try puting your custom
> code group as the sub nested codegroup within it. In addition, you can
> also try strong-named your assembly and put it in GAC, then use
> strong-named membershipCondition to idenitify it for testing.
> BTW, here is a good msdn article describing the code access security in
> ASP.NET application(including customizing policy file):
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html
> /paght000017.asp
> Hope this also helps.
> Regards,
> Steven Cheng
> Microsoft Online Community Support
>
> ==================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
>
>
>
>
>
>|||Thanks for your followup Chris,
I'm very glad that you've made progress on this. Also, it's a pleasure to
be of assistance.
Please feel free to post here when there is anything else we can help you.
Good luck!
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)