Urgent: Error While deploying ASP.net application

R

Rajesh Chaudhary

Hello everybody,
I have develoved a asp.net application, it is running fine in developmnet
environment. But when I deploy it on hosting server, the following error
message was displaying during browsing the site:

--------------------------------------------------------------
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 failed.
-------------------------------------------------------------------------------------
Then I contacted to hosting support they said their sever is configured to
trust level medium.

If I added following lines in my web.config:

<trust level="Full" originUrl=""/>

Then it is not allowed because the hosters has set this setting in
machine.config <location allowOverride="false">

So Please suggest me that how can I run my ASP.net site on hosting server in
medium trust level.
 
D

Dominick Baier [DevelopMentor]

Hi,

set the trust level to medium on your development machine to figure out what
is going wrong..

Stuff like Win32 APIs, COM, EventLog, Registry, File Access outside the web
dir is a no go in medium trust (amongst many other things).
 
R

Rajesh Chaudhary

Hi Dominick,
Actually I am using MySQL database using MySQL ODBC 3.51 Driver. I have set
trust level to medium on on development machine and found that the pages
which are not using database interaction are displaying but pages which
interacting with database are giving secrity errror issue. Here I am pasting
the stack trace, my database name is quotation:
-----------------------------------------
Stack Trace:
[SecurityException: Request failed.]
Quotation.QuoteDatabase..ctor() +0
Quotation._default..ctor() in index.aspx.vb:7
ASP.index_aspx..ctor()
-------------------------------------

I think the trust level medium does not allow database interaction through
ODBC driver.

Please give me suggestion, what should I do next.....?




--
Software Engineer
OTS Solutions Pvt Ltd.
Gurgaon
Hariana (India)
 
D

Dominick Baier [DevelopMentor]

Hi,

you are right - ODBC won't work in medium trust.

I think the only db provider that works by default is SQL Server.

Get a server where you have full trust...

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
Hi Dominick,
Actually I am using MySQL database using MySQL ODBC 3.51 Driver. I
have set
trust level to medium on on development machine and found that the
pages
which are not using database interaction are displaying but pages
which
interacting with database are giving secrity errror issue. Here I am
pasting
the stack trace, my database name is quotation:
-----------------------------------------
Stack Trace:
[SecurityException: Request failed.]
Quotation.QuoteDatabase..ctor() +0
Quotation._default..ctor() in index.aspx.vb:7
ASP.index_aspx..ctor()
-------------------------------------
I think the trust level medium does not allow database interaction
through ODBC driver.

Please give me suggestion, what should I do next.....?

Dominick Baier said:
Hi,

set the trust level to medium on your development machine to figure
out what is going wrong..

Stuff like Win32 APIs, COM, EventLog, Registry, File Access outside
the web dir is a no go in medium trust (amongst many other things).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top