Showing posts with label permissions. Show all posts
Showing posts with label permissions. Show all posts

Saturday, March 24, 2012

Permission issue with SQLDataSource?

I'd like a small overview of requirements for inserting data into a
database with SQLDataSource in regards to permissions. In the
Page_Load(), my code looks similar to this (sorry, I don't have the
code with me now):

SqlDataSource mysource = new SqlDataSource("SQLClient", myconn,
CommandType.Text );
mysource.Insert( );

The above works fine when I'm local (192.168.1.100) but once I try to
access from the outside, it fails. I'm guessing perhaps because some
type of ASPNET user is not added into SQL Server 2005 users and does
not have access to the table. What are the correct steps to allow the
code to run?

I will be using a stored procedure in place of text.

Thanks,
johnYour guess sounds right. You need to setup proper database connection.
Either introduce the asp.net user to the sql server and use windows
authentication or use sql authentication with user name and password.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"perplexed" <johnc@.bigstring.comwrote in message
news:1169592074.377111.113560@.j27g2000cwj.googlegr oups.com...

Quote:

Originally Posted by

I'd like a small overview of requirements for inserting data into a
database with SQLDataSource in regards to permissions. In the
Page_Load(), my code looks similar to this (sorry, I don't have the
code with me now):
>
SqlDataSource mysource = new SqlDataSource("SQLClient", myconn,
CommandType.Text );
mysource.Insert( );
>
The above works fine when I'm local (192.168.1.100) but once I try to
access from the outside, it fails. I'm guessing perhaps because some
type of ASPNET user is not added into SQL Server 2005 users and does
not have access to the table. What are the correct steps to allow the
code to run?
>
I will be using a stored procedure in place of text.
>
Thanks,
john
>


Thanks. I added correct permissions for network service account.
That's ok since this is local.

Permission issue with SQLDataSource?

I'd like a small overview of requirements for inserting data into a
database with SQLDataSource in regards to permissions. In the
Page_Load(), my code looks similar to this (sorry, I don't have the
code with me now):
SqlDataSource mysource = new SqlDataSource("SQLClient", myconn,
CommandType.Text );
mysource.Insert( );
The above works fine when I'm local (192.168.1.100) but once I try to
access from the outside, it fails. I'm guessing perhaps because some
type of ASPNET user is not added into SQL Server 2005 users and does
not have access to the table. What are the correct steps to allow the
code to run?
I will be using a stored procedure in place of text.
Thanks,
johnYour guess sounds right. You need to setup proper database connection.
Either introduce the asp.net user to the sql server and use windows
authentication or use sql authentication with user name and password.
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"perplexed" <johnc@.bigstring.com> wrote in message
news:1169592074.377111.113560@.j27g2000cwj.googlegroups.com...
> I'd like a small overview of requirements for inserting data into a
> database with SQLDataSource in regards to permissions. In the
> Page_Load(), my code looks similar to this (sorry, I don't have the
> code with me now):
> SqlDataSource mysource = new SqlDataSource("SQLClient", myconn,
> CommandType.Text );
> mysource.Insert( );
> The above works fine when I'm local (192.168.1.100) but once I try to
> access from the outside, it fails. I'm guessing perhaps because some
> type of ASPNET user is not added into SQL Server 2005 users and does
> not have access to the table. What are the correct steps to allow the
> code to run?
> I will be using a stored procedure in place of text.
> Thanks,
> john
>
Thanks. I added correct permissions for network service account.
That's ok since this is local.

Permissions

By default, IIS denies ASP.NET scripts to write files on the disc and create
folders. What should i do to permit ASP.NET scripts writing, for example, i
n C:\test.txt ?You need to give write (and possibly Change) permissions to the ASPNET
account.
The best way is to do it securely as outline here:
How To Create a Custom Account to Run ASP.NET
http://msdn.microsoft.com/library/e...asp?frame=true
"michael" <michael.1jbh5v@.mail.codecomments.com> wrote in message
news:michael.1jbh5v@.mail.codecomments.com...
> By default, IIS denies ASP.NET scripts to write files on the disc and
> create folders. What should i do to permit ASP.NET scripts writing, for
> example, in C:\test.txt ?
>
> --
> michael
> ---
> Posted via http://www.codecomments.com
> ---
>

permissions

I just moved my old server to a new and in the process upgraded from win2k to win2k3. The problem is whenever users try to run a page that processes a file (creates a thumbnail) the permission is denied.

I have given

ASP.NET MACHINE ACCOUNT and
INTERNET GUEST ACCOUNT

MODIFY
READ AND EXECUTE
LIST FOLDER CONTENTS
READ
WRITE

However, still no luck. Is this a security risk giving these permissions to these accounts? And what do I have to do to get it working!?. Is this because security on win2k3 is tighter? I swear it worked like a charm on win2k

Any help greatly appreciated.

Thanks

Mike123

(Error Below)

Exception Details: System.UnauthorizedAccessException: Access to the path "e:\web\pics\uploads\bob07.jpg" is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired accessso you've made the changes to permisions where? IIS console? You'll also need to alter the NTFS ACLs trhough windows explorer's 'security' pane (under the properties window)
I did that as well , but no luck =[

am i setting the wrong accounts??
Any luck since Mike?

Matt.
Yes I got it.

I believe it was the NT Services account that did not have permission that needed it.
Are you talking about the Windows NT Services, as in the modules which perform functions for Windows NT, or an actual account which I don't appear to have on my system? Where would I look for this?

More importantly, what did you do exactly to get it working?

Thanks muchly,
Matt.
Dont quote me on this but as I remember it an actual account. 2k3 is setup a bit differently. All I did was give this account permissions and it worked.

permissions

Have any of you ever set permissions programatically on a folder aspnet
user thorugh an application.

Any help will be greatly appreciated.

Thanks.Hi Maximus,

See
http://msdn.microsoft.com/library/d...tclasstopic.asp

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Maximus" <me@.maximus.net> wrote in message
news:esai$jw9DHA.3816@.tk2msftngp13.phx.gbl...
> Have any of you ever set permissions programatically on a folder aspnet
> user thorugh an application.
> Any help will be greatly appreciated.
> Thanks.
Kevin Spencer wrote:

> Hi Maximus,
> See
> http://msdn.microsoft.com/library/d...tclasstopic.asp
Hi Kevin,
Thanks for the link, but my problem was i created a folder thorugh my
application and now I want to assign the ASPNET user modify permission
on this folder. How do you think I will be able to do that using
PermissionSet, the example doesnt seem to help with that, is there any
other way of doing this.

Thanks.
My apologies, Maximus. I copied the URL from the browser address window, but
it was not the URL of the page I was looking at. Here is the correct URL:

http://msdn.microsoft.com/library/e...asp?frame=true

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Maximus" <me@.maximus.net> wrote in message
news:#QMIlSy9DHA.2064@.TK2MSFTNGP11.phx.gbl...
> Kevin Spencer wrote:
> > Hi Maximus,
> > See
http://msdn.microsoft.com/library/d...tclasstopic.asp
> Hi Kevin,
> Thanks for the link, but my problem was i created a folder thorugh my
> application and now I want to assign the ASPNET user modify permission
> on this folder. How do you think I will be able to do that using
> PermissionSet, the example doesnt seem to help with that, is there any
> other way of doing this.
> Thanks.
Kevin Spencer wrote:

> My apologies, Maximus. I copied the URL from the browser address window, but
> it was not the URL of the page I was looking at. Here is the correct URL:
> http://msdn.microsoft.com/library/e...asp?frame=true
Hi Kevin,

I thought for this you need to use WMI. What I was looking for an
example which I can refer to as I have been trying to use WMI the
examples have been refering to need the DACL property of the folder to
be accessed. Due to some reason when I get the Security settings, I see
only description and Return value as the properties I do not see the
DACL. I was wondering why?

Any help will be appreciated.

Thanks.
I'm a little lost here. What namespace are you referring to, and what
classes are you using? If you're asking about WMI, I can't answer, as I've
never used it. I do know that the System.Security.Permissions Namespace has
the classes you need to set permissions on files an folders. Specifically,
the FileIOPermission class.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Maximus" <me@.maximus.net> wrote in message
news:eWdKWLz9DHA.1672@.TK2MSFTNGP12.phx.gbl...
> Kevin Spencer wrote:
> > My apologies, Maximus. I copied the URL from the browser address window,
but
> > it was not the URL of the page I was looking at. Here is the correct
URL:
http://msdn.microsoft.com/library/e...asp?frame=true
> Hi Kevin,
> I thought for this you need to use WMI. What I was looking for an
> example which I can refer to as I have been trying to use WMI the
> examples have been refering to need the DACL property of the folder to
> be accessed. Due to some reason when I get the Security settings, I see
> only description and Return value as the properties I do not see the
> DACL. I was wondering why?
> Any help will be appreciated.
> Thanks.
Kevin Spencer wrote:

> I'm a little lost here. What namespace are you referring to, and what
> classes are you using? If you're asking about WMI, I can't answer, as I've
> never used it. I do know that the System.Security.Permissions Namespace has
> the classes you need to set permissions on files an folders. Specifically,
> the FileIOPermission class.
Hi Kevin,

Do you think using FileIOPermission Class I will be able to change
permission settings on a folder, which I created through my application,
for the ASPNet user. If so can do you have an example? As I did not find
anyway by which I could set permission settings for any user(ASPNET in
my case).

If you could send me an example or something I will greatly appreciate it.

Thanks.
Maximus wrote:

> Kevin Spencer wrote:
>> I'm a little lost here. What namespace are you referring to, and what
>> classes are you using? If you're asking about WMI, I can't answer, as
>> I've
>> never used it. I do know that the System.Security.Permissions
>> Namespace has
>> the classes you need to set permissions on files an folders.
>> Specifically,
>> the FileIOPermission class.
>>
> Hi Kevin,
> Do you think using FileIOPermission Class I will be able to change
> permission settings on a folder, which I created through my application,
> for the ASPNet user. If so can do you have an example? As I did not find
> anyway by which I could set permission settings for any user(ASPNET in
> my case).
> If you could send me an example or something I will greatly appreciate it.
> Thanks.
Hi Kevin,

Please help, I have been breaking my head for a few days now but to no
avail. I have no clue as to how I will set permission on a folder
created thorugh the appliction for aspnet user. Any example for the same
will be greatly appreciated.

Thanks.
Hi Maximus,

If you follow the link I posted to the System.Security.Permissions page
(http://msdn.microsoft.com/library/e...emSecurityPermi
ssions.asp?frame=true), and follow the link on that page to the page about
the FileIOPermission class
(http://msdn.microsoft.com/library/e...emsecuritypermi
ssionsfileiopermissionclasstopic.asp?frame=true), there are examples right
on that page you can go by.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Maximus" <me@.maximus.net> wrote in message
news:en8zlF09DHA.2324@.tk2msftngp13.phx.gbl...
> Maximus wrote:
> > Kevin Spencer wrote:
> >> I'm a little lost here. What namespace are you referring to, and what
> >> classes are you using? If you're asking about WMI, I can't answer, as
> >> I've
> >> never used it. I do know that the System.Security.Permissions
> >> Namespace has
> >> the classes you need to set permissions on files an folders.
> >> Specifically,
> >> the FileIOPermission class.
> >>
> > Hi Kevin,
> > Do you think using FileIOPermission Class I will be able to change
> > permission settings on a folder, which I created through my application,
> > for the ASPNet user. If so can do you have an example? As I did not find
> > anyway by which I could set permission settings for any user(ASPNET in
> > my case).
> > If you could send me an example or something I will greatly appreciate
it.
> > Thanks.
> Hi Kevin,
> Please help, I have been breaking my head for a few days now but to no
> avail. I have no clue as to how I will set permission on a folder
> created thorugh the appliction for aspnet user. Any example for the same
> will be greatly appreciated.
> Thanks.
Kevin Spencer wrote:

> Hi Maximus,
> If you follow the link I posted to the System.Security.Permissions page
> (http://msdn.microsoft.com/library/e...emSecurityPermi
> ssions.asp?frame=true), and follow the link on that page to the page about
> the FileIOPermission class
> (http://msdn.microsoft.com/library/e...emsecuritypermi
> ssionsfileiopermissionclasstopic.asp?frame=true), there are examples right
> on that page you can go by.
Hi kevin,

Even if I follow the link I dont see how I can specify the ASPNET user
in the FileIOPermission class. I dont see any function that will let me
specify for what user I can change the permission. Do you think its
possible if so can you pinpoint the function I can use?

Thanks.
Okay, the FileIOPermission class sets permission for the code being run. If
you want to set Permission for a specific user, use the PrincipalPermission
class.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Kevin Spencer" <kevin@.takempis.com> wrote in message
news:OL0jrw79DHA.3428@.tk2msftngp13.phx.gbl...
> Hi Maximus,
> If you follow the link I posted to the System.Security.Permissions page
(http://msdn.microsoft.com/library/e...emSecurityPermi
> ssions.asp?frame=true), and follow the link on that page to the page about
> the FileIOPermission class
(http://msdn.microsoft.com/library/e...emsecuritypermi
> ssionsfileiopermissionclasstopic.asp?frame=true), there are examples right
> on that page you can go by.
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
> "Maximus" <me@.maximus.net> wrote in message
> news:en8zlF09DHA.2324@.tk2msftngp13.phx.gbl...
> > Maximus wrote:
> > > Kevin Spencer wrote:
> > > >> I'm a little lost here. What namespace are you referring to, and what
> > >> classes are you using? If you're asking about WMI, I can't answer, as
> > >> I've
> > >> never used it. I do know that the System.Security.Permissions
> > >> Namespace has
> > >> the classes you need to set permissions on files an folders.
> > >> Specifically,
> > >> the FileIOPermission class.
> > >>
> > > Hi Kevin,
> > > > Do you think using FileIOPermission Class I will be able to change
> > > permission settings on a folder, which I created through my
application,
> > > for the ASPNet user. If so can do you have an example? As I did not
find
> > > anyway by which I could set permission settings for any user(ASPNET in
> > > my case).
> > > > If you could send me an example or something I will greatly appreciate
> it.
> > > > Thanks.
> > > Hi Kevin,
> > Please help, I have been breaking my head for a few days now but to no
> > avail. I have no clue as to how I will set permission on a folder
> > created thorugh the appliction for aspnet user. Any example for the same
> > will be greatly appreciated.
> > Thanks.

Permissions

By default, IIS denies ASP.NET scripts to write files on the disc and
create folders. What should i do to permit ASP.NET scripts writing, for
example, in C:\test.txt ?

--
michael
----------------------
Posted via http://www.codecomments.com
----------------------You need to give write (and possibly Change) permissions to the ASPNET
account.

The best way is to do it securely as outline here:

How To Create a Custom Account to Run ASP.NET

http://msdn.microsoft.com/library/e...asp?frame=true

"michael" <michael.1jbh5v@.mail.codecomments.com> wrote in message
news:michael.1jbh5v@.mail.codecomments.com...
> By default, IIS denies ASP.NET scripts to write files on the disc and
> create folders. What should i do to permit ASP.NET scripts writing, for
> example, in C:\test.txt ?
>
> --
> michael
> ----------------------
> Posted via http://www.codecomments.com
> ----------------------

Permissions - giving "everyone" full permissions is bad ?

Hi all,
I have developed an ASP.NET application, on my Windows XP using visual studi
o 2003 professional.
Now I want to deploy this app to a windows 2003 web edition server, so my cu
stomers can test the app.
I have prepared a new site on the windows 2003 server, and copied all files
over to this server.
It works perfectly, but when my app tries to create / write to a TXT file, i
t throws an "System.UnauthorizedAccessException" exception. If I test ASPX f
iles which does not try to create a TXT file, I get no exception.
So I go into the properties for the dir where this TXT file is, and adds ASP
NET user and gives it "modify" permissions - no luck!
I then do the same with the "IUSR_<machine>" user - no luck!
Finally, in total desperation, I add the "Everyone" user and gives it FULL a
ccess, and then my ASP.NET application works ...
My question is now :
1) How do I setup the right permissions ? I cannot be true, that I need to a
dd full permissions to the "Everyone" user account ...
Am I missing something here ? Please help me ...
Regards,
Tony Fonager, DenmarkHi Tony:
One of the best ways to debug an issue like this is to turn on
auditing for objects and then get a log of exactly who is being denied
permission.
For some more information see:
http://odetocode.com/Blogs/scott/ar.../06/22/283.aspx
Scott
http://www.OdeToCode.com
On Tue, 13 Jul 2004 12:58:02 -0700, Tony Fonager
<fonager@.newsgroups.nospam> wrote:

>Hi all,
>I have developed an ASP.NET application, on my Windows XP using visual stud
io 2003 professional.
>Now I want to deploy this app to a windows 2003 web edition server, so my c
ustomers can test the app.
>I have prepared a new site on the windows 2003 server, and copied all files
over to this server.
>It works perfectly, but when my app tries to create / write to a TXT file,
it throws an "System.UnauthorizedAccessException" exception. If I test ASPX
files which does not try to create a TXT file, I get no exception.
>So I go into the properties for the dir where this TXT file is, and adds AS
PNET user and gives it "modify" permissions - no luck!
>I then do the same with the "IUSR_<machine>" user - no luck!
>Finally, in total desperation, I add the "Everyone" user and gives it FULL
access, and then my ASP.NET application works ...
>My question is now :
>1) How do I setup the right permissions ? I cannot be true, that I need to
add full permissions to the "Everyone" user account ...
>Am I missing something here ? Please help me ...
>
>Regards,
>Tony Fonager, Denmark
Oh, forgot to mention, I think what you'll find on your 2003 server is
that the NETWORK SERVICE account will be the context trying to write
to the file.
--s
On Tue, 13 Jul 2004 12:58:02 -0700, Tony Fonager
<fonager@.newsgroups.nospam> wrote:

>Hi all,
>I have developed an ASP.NET application, on my Windows XP using visual stud
io 2003 professional.
>Now I want to deploy this app to a windows 2003 web edition server, so my c
ustomers can test the app.
>I have prepared a new site on the windows 2003 server, and copied all files
over to this server.
>It works perfectly, but when my app tries to create / write to a TXT file,
it throws an "System.UnauthorizedAccessException" exception. If I test ASPX
files which does not try to create a TXT file, I get no exception.
>So I go into the properties for the dir where this TXT file is, and adds AS
PNET user and gives it "modify" permissions - no luck!
>I then do the same with the "IUSR_<machine>" user - no luck!
>Finally, in total desperation, I add the "Everyone" user and gives it FULL
access, and then my ASP.NET application works ...
>My question is now :
>1) How do I setup the right permissions ? I cannot be true, that I need to
add full permissions to the "Everyone" user account ...
>Am I missing something here ? Please help me ...
>
>Regards,
>Tony Fonager, Denmark
Scott
http://www.OdeToCode.com
Scott,
That was exactly the account I needed to change permissions for - thanks alo
t, now I can control permissions, and I just tested it with success.
And thanks for at FAST reply :-)
-
Tony Fonager
"Scott Allen" wrote:

> Oh, forgot to mention, I think what you'll find on your 2003 server is
> that the NETWORK SERVICE account will be the context trying to write
> to the file.
> --s
> On Tue, 13 Jul 2004 12:58:02 -0700, Tony Fonager
> <fonager@.newsgroups.nospam> wrote:
>
> --
> Scott
> http://www.OdeToCode.com
>

permissions creating web application

The following error seems to plague a lot of people. Who has encountered this and what solutions did you find.

"Unable to create web project <name>. The UNC share <UNC> does not exist or you do not have access.

One suggestion I have seen a few times is create the app on the local machine and then publish to the server. I want to create the app on my develoment server, not on my local machine and then publish to a production box.

I noticed a post from one of this forums "ASP.net team" users stating something along the lines of "creating a web application is a snap just go to New Project --> .net web application". I laughed big time at that. I am in my fourth day of attempting this "snap" process.It works fine, but you have to make sure you have the correct privelages.. From the error it seems you don't have write permissions maybe?
yeah it is a permissions issue. The question is permissions for who? You have my local machine with VS.net installed. I log into a domain so I am assuming that the VS application is running with that account information.

I then try to create an application on a server outside a firewall and not part of the domain. That IIS server is running the show as far as the virtual directory and web application is concerned so I assume the account is IUSR_machine.

That to me seems to be a potential source of this problem.
Check if you have permissions on the directory you are trying to write to. I believe this is just directory permissions you are dealing with here.

permissions & roles...

Is it possible to find out what the permissions & roles are for the
'ASP.NET' and the 'NETWORK SERVICE' accounts?

Cheers

Ollie RichesHi, Ollie.

Please see :

http://msdn.microsoft.com/library/d.../SecNetHT01.asp

best regards,

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Ollie Riches" <ollie.riches@.phoneanalyser.net> wrote in message
news:eVJ$PMUvFHA.3556@.TK2MSFTNGP12.phx.gbl...
> Is it possible to find out what the permissions & roles are for the 'ASP.NET' and the
> 'NETWORK SERVICE' accounts?
> Cheers
> Ollie Riches

permissions & roles...

Is it possible to find out what the permissions & roles are for the
'ASP.NET' and the 'NETWORK SERVICE' accounts?
Cheers
Ollie RichesHi, Ollie.
Please see :
http://msdn.microsoft.com/library/d.../>
NetHT01.asp
best regards,
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Ollie Riches" <ollie.riches@.phoneanalyser.net> wrote in message
news:eVJ$PMUvFHA.3556@.TK2MSFTNGP12.phx.gbl...
> Is it possible to find out what the permissions & roles are for the 'ASP.N
ET' and the
> 'NETWORK SERVICE' accounts?
> Cheers
> Ollie Riches
>

Permissions Error .. ?

Normally, the data that I work with is on an SQL Server, which is
installed on the web server itself or another local server on the LAN. I
tried connecting to an access database on another server, which I could
fine when designing the page. But, when I ran the page on the web
server, I got this error:

The Microsoft Jet database engine cannot open the file
'\\fileserv\database\transportation\trantrack2003B _testing.mdb'. It is
already opened exclusively by another user, or you need permission to
view its data.

I don't believe I could add permissions to this file for the ASP.NET
account on the web server to access it. How would I go about
'impersonating', as I've heard mentioned before, if this would solve my
problem?I don't believe I could add permissions to this file for the ASP.NET

Quote:

Originally Posted by

account on the web server to access it. How would I go about
'impersonating', as I've heard mentioned before, if this would solve my
problem?


Have a look under the web.config section of:
http://west-wind.com/weblog/posts/2153.aspx
which should help.

Permissions Error When Accessing Access Database

When I attempt to access a Microsoft Access database from my website, I
recieve the following error:

Server Error in '/' Application.
------------------------

Security Exception
Description: The application attempted to perform an operation not allowed
by the security policy. To grant this application the required permission
please contact your system administrator or change the application's trust
level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the
permission of type 'System.Data.OleDb.OleDbPermission, System.Data,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Take note that the description says that this can be fixed by modifying the
configuration file, which I am assuming is referring to the Web.config file.
I have successfully run this application on my machine using Visual Studio
2005's Development Server with the settings currently in the Web.config
file, so if modifying the Web.config file will fix it, what do I need to
change? Thanks.
--
Nathan Sokalski
njsokalski@dotnet.itags.org.hotmail.com
http://www.nathansokalski.com/On Jun 29, 2:50 am, "Nathan Sokalski" <njsokal...@.hotmail.comwrote:

Quote:

Originally Posted by

When I attempt to access a Microsoft Access database from my website, I
recieve the following error:
>
Server Error in '/' Application.
-----------------------*--
>
Security Exception
Description: The application attempted to perform an operation not allowed
by the security policy. To grant this application the required permission
please contact your system administrator or change the application's trust
level in the configuration file.
>
Exception Details: System.Security.SecurityException: Request for the
permission of type 'System.Data.OleDb.OleDbPermission, System.Data,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
>
Take note that the description says that this can be fixed by modifying the
configuration file, which I am assuming is referring to the Web.config file.
I have successfully run this application on my machine using Visual Studio
2005's Development Server with the settings currently in the Web.config
file, so if modifying the Web.config file will fix it, what do I need to
change? Thanks.
--
Nathan Sokalski
njsokal...@.hotmail.comhttp://www.nathansokalski.com/


Why do you use OleDb for MS Access?

http://msdn2.microsoft.com/en-us/li...connection.aspx
An application that creates an instance of the OleDbConnection object
can require all direct and indirect callers to have sufficient
permission to the code by setting declarative or imperative security
demands. OleDbConnection makes security demands using the
OleDbPermission object. Users can verify that their code has
sufficient permissions by using the OleDbPermissionAttribute object.
Users and administrators can also use the Code Access Security Policy
Tool (Caspol.exe) to modify security policy at the computer, user, and
enterprise levels. For more information, see Code Access Security and
ADO.NET.

http://msdn2.microsoft.com/en-us/library/0x4t63kb.aspx
I use OleDb for MS Access because of the namespaces that are included in the
..NET Framework (or that I have ever heard of from third parties)
System.Data.OleDb is the one that is supposed to be used when accessing a MS
Access database. The reason I am using MS Access for this website rather
than a higher quality database such as SQL Server or Oracle is because the
organization the site is for cannot afford anything else.

I have used System.Data.OleDb for MS Access databases in other sites I have
written, such as my personal website, with no problem, and any books that I
have read that use MS Access as their example database have as well, so I
know that it is the right one to use.

I have never had to deal with any of the objects you mention (except for
OleDbConnection, of course). Could you please either give me a code sample
or direct me to a site that gives one? Thanks.
--
Nathan Sokalski
njsokalski@.hotmail.com
http://www.nathansokalski.com/
"Alexey Smirnov" <alexey.smirnov@.gmail.comwrote in message
news:1183101114.868636.153110@.c77g2000hse.googlegr oups.com...
On Jun 29, 2:50 am, "Nathan Sokalski" <njsokal...@.hotmail.comwrote:

Quote:

Originally Posted by

When I attempt to access a Microsoft Access database from my website, I
recieve the following error:
>
Server Error in '/' Application.
-----------------------*--
>
Security Exception
Description: The application attempted to perform an operation not allowed
by the security policy. To grant this application the required permission
please contact your system administrator or change the application's trust
level in the configuration file.
>
Exception Details: System.Security.SecurityException: Request for the
permission of type 'System.Data.OleDb.OleDbPermission, System.Data,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
>
Take note that the description says that this can be fixed by modifying
the
configuration file, which I am assuming is referring to the Web.config
file.
I have successfully run this application on my machine using Visual Studio
2005's Development Server with the settings currently in the Web.config
file, so if modifying the Web.config file will fix it, what do I need to
change? Thanks.
--
Nathan Sokalski
njsokal...@.hotmail.comhttp://www.nathansokalski.com/


Why do you use OleDb for MS Access?

http://msdn2.microsoft.com/en-us/li...connection.aspx
An application that creates an instance of the OleDbConnection object
can require all direct and indirect callers to have sufficient
permission to the code by setting declarative or imperative security
demands. OleDbConnection makes security demands using the
OleDbPermission object. Users can verify that their code has
sufficient permissions by using the OleDbPermissionAttribute object.
Users and administrators can also use the Code Access Security Policy
Tool (Caspol.exe) to modify security policy at the computer, user, and
enterprise levels. For more information, see Code Access Security and
ADO.NET.

http://msdn2.microsoft.com/en-us/library/0x4t63kb.aspx
"Alexey Smirnov" <alexey.smirnov@.gmail.comwrote in message
news:1183101114.868636.153110@.c77g2000hse.googlegr oups.com...

Quote:

Originally Posted by

Why do you use OleDb for MS Access?


How else would you expect to use a Jet database within the .NET
Framework...?

--
http://www.markrae.net

Wednesday, March 21, 2012

Permissions Error When Accessing Access Database

When I attempt to access a Microsoft Access database from my website, I
recieve the following error:
Server Error in '/' Application.
----
--
Security Exception
Description: The application attempted to perform an operation not allowed
by the security policy. To grant this application the required permission
please contact your system administrator or change the application's trust
level in the configuration file.
Exception Details: System.Security.SecurityException: Request for the
permission of type 'System.Data.OleDb.OleDbPermission, System.Data,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Take note that the description says that this can be fixed by modifying the
configuration file, which I am assuming is referring to the Web.config file.
I have successfully run this application on my machine using Visual Studio
2005's Development Server with the settings currently in the Web.config
file, so if modifying the Web.config file will fix it, what do I need to
change? Thanks.
--
Nathan Sokalski
njsokalski@dotnet.itags.org.hotmail.com
http://www.nathansokalski.com/On Jun 29, 2:50 am, "Nathan Sokalski" <njsokal...@.hotmail.com> wrote:
> When I attempt to access a Microsoft Access database from my website, I
> recieve the following error:
> Server Error in '/' Application.
> ----=
--=AD--
> Security Exception
> Description: The application attempted to perform an operation not allowed
> by the security policy. To grant this application the required permission
> please contact your system administrator or change the application's trust
> level in the configuration file.
> Exception Details: System.Security.SecurityException: Request for the
> permission of type 'System.Data.OleDb.OleDbPermission, System.Data,
> Version=3D2.0.0.0, Culture=3Dneutral, PublicKeyToken=3Db77a5c561934e089' =
failed.
> Take note that the description says that this can be fixed by modifying t=
he
> configuration file, which I am assuming is referring to the Web.config fi=
le.
> I have successfully run this application on my machine using Visual Studio
> 2005's Development Server with the settings currently in the Web.config
> file, so if modifying the Web.config file will fix it, what do I need to
> change? Thanks.
> --
> Nathan Sokalski
> njsokal...@.hotmail.comhttp://www.nathansokalski.com/
Why do you use OleDb for MS Access?
http://msdn2.microsoft.com/en-us/li...edbconnection.=
aspx
An application that creates an instance of the OleDbConnection object
can require all direct and indirect callers to have sufficient
permission to the code by setting declarative or imperative security
demands. OleDbConnection makes security demands using the
OleDbPermission object. Users can verify that their code has
sufficient permissions by using the OleDbPermissionAttribute object.
Users and administrators can also use the Code Access Security Policy
Tool (Caspol.exe) to modify security policy at the computer, user, and
enterprise levels. For more information, see Code Access Security and
ADO.NET.
http://msdn2.microsoft.com/en-us/library/0x4t63kb.aspx
I use OleDb for MS Access because of the namespaces that are included in the
.NET Framework (or that I have ever heard of from third parties)
System.Data.OleDb is the one that is supposed to be used when accessing a MS
Access database. The reason I am using MS Access for this website rather
than a higher quality database such as SQL Server or Oracle is because the
organization the site is for cannot afford anything else.
I have used System.Data.OleDb for MS Access databases in other sites I have
written, such as my personal website, with no problem, and any books that I
have read that use MS Access as their example database have as well, so I
know that it is the right one to use.
I have never had to deal with any of the objects you mention (except for
OleDbConnection, of course). Could you please either give me a code sample
or direct me to a site that gives one? Thanks.
--
Nathan Sokalski
njsokalski@.hotmail.com
http://www.nathansokalski.com/
"Alexey Smirnov" <alexey.smirnov@.gmail.com> wrote in message
news:1183101114.868636.153110@.c77g2000hse.googlegroups.com...
On Jun 29, 2:50 am, "Nathan Sokalski" <njsokal...@.hotmail.com> wrote:
> When I attempt to access a Microsoft Access database from my website, I
> recieve the following error:
> Server Error in '/' Application.
> ----
-_--
> Security Exception
> Description: The application attempted to perform an operation not allowed
> by the security policy. To grant this application the required permission
> please contact your system administrator or change the application's trust
> level in the configuration file.
> Exception Details: System.Security.SecurityException: Request for the
> permission of type 'System.Data.OleDb.OleDbPermission, System.Data,
> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
> Take note that the description says that this can be fixed by modifying
> the
> configuration file, which I am assuming is referring to the Web.config
> file.
> I have successfully run this application on my machine using Visual Studio
> 2005's Development Server with the settings currently in the Web.config
> file, so if modifying the Web.config file will fix it, what do I need to
> change? Thanks.
> --
> Nathan Sokalski
> njsokal...@.hotmail.comhttp://www.nathansokalski.com/
Why do you use OleDb for MS Access?
http://msdn2.microsoft.com/en-us/li...y/0x4t63kb.aspx
"Alexey Smirnov" <alexey.smirnov@.gmail.com> wrote in message
news:1183101114.868636.153110@.c77g2000hse.googlegroups.com...

> Why do you use OleDb for MS Access?
How else would you expect to use a Jet database within the .NET
Framework...?
http://www.markrae.net

Permissions for ASPNET Account

Hi All,

I've recently install the framework on a web server (First 'production' one
I've done)

Should the ASPNET account have read/write access to the web root and beyond?
Or just the areas where I'll use asp.net? Or perhaps just read access? (With
write access to specific areas where maybe txt files are amended?)

Would appreciate a little guideance.

Thanks!
Simon.It should have whatever permissions it needs to do what it needs to do; no
more, and no less.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Simon Harris" <too-much-spam@.makes-you-fat.com> wrote in message
news:etZmcM28EHA.3260@.TK2MSFTNGP14.phx.gbl...
> Hi All,
> I've recently install the framework on a web server (First 'production'
> one I've done)
> Should the ASPNET account have read/write access to the web root and
> beyond? Or just the areas where I'll use asp.net? Or perhaps just read
> access? (With write access to specific areas where maybe txt files are
> amended?)
> Would appreciate a little guideance.
> Thanks!
> Simon.
Check out this link to know about permissions required by asp.net
http://support.microsoft.com/defaul...kb;en-us;317012

--
Saravana
http://dotnetjunkies.com/WebLog/saravana/
www.ExtremeExperts.com

"Simon Harris" <too-much-spam@.makes-you-fat.com> wrote in message
news:etZmcM28EHA.3260@.TK2MSFTNGP14.phx.gbl...
> Hi All,
> I've recently install the framework on a web server (First 'production'
one
> I've done)
> Should the ASPNET account have read/write access to the web root and
beyond?
> Or just the areas where I'll use asp.net? Or perhaps just read access?
(With
> write access to specific areas where maybe txt files are amended?)
> Would appreciate a little guideance.
> Thanks!
> Simon.

Permissions for ASPNET Account

Hi All,
I've recently install the framework on a web server (First 'production' one
I've done)
Should the ASPNET account have read/write access to the web root and beyond?
Or just the areas where I'll use asp.net? Or perhaps just read access? (With
write access to specific areas where maybe txt files are amended?)
Would appreciate a little guideance.
Thanks!
Simon.It should have whatever permissions it needs to do what it needs to do; no
more, and no less.
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.
"Simon Harris" <too-much-spam@.makes-you-fat.com> wrote in message
news:etZmcM28EHA.3260@.TK2MSFTNGP14.phx.gbl...
> Hi All,
> I've recently install the framework on a web server (First 'production'
> one I've done)
> Should the ASPNET account have read/write access to the web root and
> beyond? Or just the areas where I'll use asp.net? Or perhaps just read
> access? (With write access to specific areas where maybe txt files are
> amended?)
> Would appreciate a little guideance.
> Thanks!
> Simon.
>
Check out this link to know about permissions required by asp.net
http://support.microsoft.com/defaul...kb;en-us;317012
Saravana
http://dotnetjunkies.com/WebLog/saravana/
www.ExtremeExperts.com
"Simon Harris" <too-much-spam@.makes-you-fat.com> wrote in message
news:etZmcM28EHA.3260@.TK2MSFTNGP14.phx.gbl...
> Hi All,
> I've recently install the framework on a web server (First 'production'
one
> I've done)
> Should the ASPNET account have read/write access to the web root and
beyond?
> Or just the areas where I'll use asp.net? Or perhaps just read access?
(With
> write access to specific areas where maybe txt files are amended?)
> Would appreciate a little guideance.
> Thanks!
> Simon.
>

Permissions for website on localhost

I have a site "http://localhost/mysite" which has a page containing a window
s
user control which displays a list of all files in a folder on the client
machine.
When I run the webapp I obviously get an error message saying that the .net
framework wont allow permissions to do such a thing.
Can anyone tell me how I can set permissions on my machine so that I can run
this ?Have you defined the permissions in the IIS website properties?
Thats not the problem.
Its the client. I must set up the .net framework to accept any actions
coming from this URL. It must allow my dll to perform whatever it wants on
the client machine.
It just so happens that its on localhost at the moment.
Start here:
http://msdn.microsoft.com/library/d...esssecurity.asp
I have gone in to the .net configuration manager and set the URL as trusted
but still no joy.
To be honest, I'm not sure if this is even possible--at least, without
extensive work.
ASP.NET code executes on the server, and as such, that is all it has
access to.
In addition, JavaScript is restricted from accessing the file system,
so that rules that out.
The only way I could imagine being able to access the client's file
system is to create an ActiveX control that the clients would have to
download and install, and that code would have to be trusted on the
client machine.
You may be better off to re-evaluate the architecture of your
application--does it really need this functionality? If the answer is
yes, you should probably look into developing a windows forms/smart
client.
What exactly are you trying to do, anyway? Why would a user go to your
website to navigate the files on his local machine?

Permissions for website on localhost

I have a site "http://localhost/mysite" which has a page containing a windows
user control which displays a list of all files in a folder on the client
machine.
When I run the webapp I obviously get an error message saying that the .net
framework wont allow permissions to do such a thing.

Can anyone tell me how I can set permissions on my machine so that I can run
this ?Have you defined the permissions in the IIS website properties?
Thats not the problem.

Its the client. I must set up the .net framework to accept any actions
coming from this URL. It must allow my dll to perform whatever it wants on
the client machine.

It just so happens that its on localhost at the moment.
Start here:

http://msdn.microsoft.com/library/d...esssecurity.asp
I have gone in to the .net configuration manager and set the URL as trusted
but still no joy.
To be honest, I'm not sure if this is even possible--at least, without
extensive work.

ASP.NET code executes on the server, and as such, that is all it has
access to.

In addition, JavaScript is restricted from accessing the file system,
so that rules that out.

The only way I could imagine being able to access the client's file
system is to create an ActiveX control that the clients would have to
download and install, and that code would have to be trusted on the
client machine.

You may be better off to re-evaluate the architecture of your
application--does it really need this functionality? If the answer is
yes, you should probably look into developing a windows forms/smart
client.

What exactly are you trying to do, anyway? Why would a user go to your
website to navigate the files on his local machine?

Permissions Help with asp.net saving uploaded files

I have a function that uploads a file to a specific directory, making the
directory if it doesn't already exist.

This works, unless I try to upload a file to a pre-existing directory. If I
do that, I get this vague error:

Exception has been thrown by the target of an invocation.

From what I can tell, this is maybe a permissions issue?

'aspnet_wp account' has full control over the parent directory and any
directory it makes. The only oddity is that upon first creation of a
directory, I get prompted by the browser to enter my own network
username/pwd.

I'm completely stuck on this and really have no idea what to check for. Is
there anyway to get a more specific error message out of the application
than the one above?

-Darrel> I'm completely stuck on this and really have no idea what to check for. Is
> there anyway to get a more specific error message out of the application
> than the one above?

Aha. I figured that part out:

exc.InnerException.Message

Which gives me a much more specific answer...access denied for the
particular directory I'm trying to save to.

So, what should I check for? What is odd is that my application is just fine
creating the directory and then immediately uploading some files to it. It's
only on subsequent attempts does it get the access deined error.

-Darrel

Permissions issue running .aspx files...

I'm running 2003 server (it's running AD also) and I've been hosting asp files on it no problem. Just installed WebMatrix and my first, simple file won't load, I get the following error:

Server cannot access application directory "C:\Inetpub\www". The directory does not exist or is not accessible because of security settings.

Now of course the directory exists, and the permissions were (and remain) set properly for my other .asp files to run, just not the .aspx files I create with WebMatrix. All my googling indicates I have to set the permissions for an ASPNET user, which apparently 2003 doesn't use; NETWORK SERVICES runs stuff, but as that's not a user per se, I don't know how to "give it rights" so I'm at a loss.

I gave full rights (just to test, I set these back after) for the IUSER, IWAM, and IIS_WPG users, and no soup. I also have a user OWS_xxxxxxx_admin which is described as "MIcrosoft SharePoint role 'admin' for web..." but that also didn't do it. Here's why I definitely think it's a rights issue: I gave "Everybody" full rights and then my page loads. Here's the kicker though; I took away "Everybody" and gave just "Doman Users" full rights, and it doesn't work. So the impression I get is that it's trying to use a username to run scripts that doesn't exist in my domain... as if the user was somehow 'lost'.

I've also heard mention of a machine.cfg file which has the username in it to use for running scripts, but I do not appear to have such a file. Is that normal on 2k3?

Any help would be appreciated. My next resort is going to be to backup my www, and uninstall and reinstall IIS, which I would like to avoid, as my plethora of other web projects are all working. Thanks!!Update: I was wrong about the machine.cfg file, because I had the wrong extension, I see now that it's machine.config. However, I followed a knowledge base article which said to create a weak user, give it log on as a batch rights, and then add it to the machine.config file and reboot. Still no soup.

Tongue Tied [:S] Um, bump? Anybody have any ideas? I'm still stuck on this, and haven't found anything else in my research.
Thanks in advance!


JazzGilbert wrote:

C:\Inetpub\www". The directory does not exist or is not accessible because of security settings

Who is listed on the security tab for WWW?

FYI I am also on 2003 server with AD

Have you configured the directory as an application and have you configured the web service extenstions for asp.net xxxxx

Is aspx listed in Virtual or Home Directory Tab: Configuration...:Mappings Tab:Application extensions for your application subdirectoy?


Ok, on the WWW folder under Security, I've got the following:
ASPUser with Full Rights (I created this user per the KB article)
IIS_WPG with Read & Execute
the Internet Guest Account (IUSR_machinename) with Read & Execute
the Launch IIS Process Account (IWAM_machinename) with Read & Execute

I've tried, one at a time, giving them full control, that didn't make a difference.

Maybe that's the issue, (configuring the directory as an app) because all I did was create a folder in my WWW and made sure it had the same rights as the WWW folder.

As far as extensions, I am able to run notepad created .asp files. It's the .aspx file I created in WebMatrix that fails. I think I have the right services setup, but here's a screenshot.

http://www.abeyantdestiny.com/services.gif


I think you need to create an app on the directory tab of the folder.

Also check to see which application pool is selected. It should be "ASP.NET"

Then check the identity being used by that pool.

Also to test that is has nothing to do with webmatrix... take a extreamly simple html page that you know already works on your web page and simply change the extenstion from .html to .aspx

If it works then it is webmatrix that is causing the problem if it doesn't then it is a server config issuse.

Also I can perhaps send some screen shots of my config if you need. If desired then send an private email using this site and include your email address.

Permissions Issue

Hello, I am tring to create a .mdb db programatically on my server. It works just fine on my pc but not when I attempt it on my online server. I got a security exception error which stated I needed to chage the applications trust level. So I attempted to change the trust and added this to my config file:

<securityPolicy>

<trustLevelname="Full"policyFile="internal" />

</securityPolicy >

<trustlevel="Full" />

Now i get this configuration error:

Parser Error Message:This configuration section cannot be used at this path. This happens when the site administrator has locked access to this section using <location allowOverride="false"> from an inherited configuration file.

Source Error:

Line 64: <customErrors mode="Off"/>Line 65:Line 66: <securityPolicy>Line 67: <trustLevel name="Full" policyFile="internal" />Line 68: </securityPolicy >

Any Ideas on how to fix this? Thanks!

Have you tried allowOverride=true?

<location allowOverride="true"><system.web><securityPolicy><trustLevel name="Full" policyFile="internal" /></securityPolicy ></system.web>

Thanks for the reply. I did try this before and I got this runtime error:

Description:An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

But i already have<customErrorsmode="off"/> in my config file. Im not sure what to do.



Hi grogo21,

Based on my understanding, this is because the site administrator of your online server has locked access to this section so you are not able to override the setting. In application hosting scenarios, administrator might want to lock some settings of an ASP.NET application to prevent modification at lower levels. You need to contact your site administrator for help if you don't have such permissions.

Please check this document for more details.

http://msdn2.microsoft.com/en-us/library/ms178693.aspx