473,841 Members | 1,792 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.Security .SecurityExcept ion: Permission denied Error while invoking methods in a Component


Hi,
I am getting an error while trying to create an excel file.
"Descriptio n: 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 .SecurityExcept ion: Permission denied"

This is what I am doing. we had an app that was written in VB to take
specific dates and create an excel file.
I am using the dll in my .NET app but it displays the error while writing
the file...

I am sure that I have used regsrv32 to register the DLL

any suggestions,
Stephen
Aug 8 '06 #1
4 9101
you said you are using the COM server DLL directly in .net? If thats
what you are doing.. you need to create an interop assembly before you
can access the methods in that dll

Please let me know if I understoof your question incorrectly

stephen wrote:
Hi,
I am getting an error while trying to create an excel file.
"Descriptio n: 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 .SecurityExcept ion: Permission denied"

This is what I am doing. we had an app that was written in VB to take
specific dates and create an excel file.
I am using the dll in my .NET app but it displays the error while writing
the file...

I am sure that I have used regsrv32 to register the DLL

any suggestions,
Stephen
Aug 8 '06 #2
Are you trying to run the application over the network? If so, see
http://blogs.msdn.com/shawnfa/archiv.../20/57023.aspx. (If you're
using version 2.0 of the .NET framework, ClickOnce is another option for
permissions elevation.)

If you're not attempting to run the applicaiton over the network, could you
please post the complete exception details (including call stack listing),
as returned from its ToString method?

"stephen" <st********@hot mail.comwrote in message
news:%2******** *******@TK2MSFT NGP06.phx.gbl.. .
>
Hi,
I am getting an error while trying to create an excel file.
"Descriptio n: 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 .SecurityExcept ion: Permission denied"

This is what I am doing. we had an app that was written in VB to take
specific dates and create an excel file.
I am using the dll in my .NET app but it displays the error while writing
the file...

I am sure that I have used regsrv32 to register the DLL

any suggestions,
Stephen
Aug 8 '06 #3
Hi Kumar and Nicole,

This is how I am working on this project. I have a DLL given to me by
another developer that generates Excel files and he created it using VB6.
I registered it on my box, referenced it and I am trying to use it
This is the error I am getting along with stack trace:

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 .SecurityExcept ion: Permission denied
[SecurityExcepti on: Permission denied]
CBAS_DTStoExcel .CBQueryDTStoEx celClass.set_Ou tPath(Object ) +0
cbas.QueryDB.Ex portToExcel(Dat eTime dBeginDate, DateTime dEndDate) in
C:\Inetpub\wwwr oot\CBAS_Deploy \QueryDB.aspx.v b:74
cbas.QueryDB.bt nRunReport_Clic k(Object sender, EventArgs e) in
C:\Inetpub\wwwr oot\CBAS_Deploy \QueryDB.aspx.v b:53
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +2112
System.Web.UI.P age.ProcessRequ est() +217
System.Web.UI.P age.ProcessRequ est(HttpContext context) +18
System.Web.Call HandlerExecutio nStep.System.We b.HttpApplicati on+IExecutionSt ep.Execute()
+179
System.Web.Http Application.Exe cuteStep(IExecu tionStep step, Boolean&
completedSynchr onously) +87


"Kumar Reddi" <ku********@gma il.comwrote in message
news:11******** *************@h 48g2000cwc.goog legroups.com...
you said you are using the COM server DLL directly in .net? If thats
what you are doing.. you need to create an interop assembly before you
can access the methods in that dll

Please let me know if I understoof your question incorrectly

stephen wrote:
>Hi,
I am getting an error while trying to create an excel file.
"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 .SecurityExcept ion: Permission denied"

This is what I am doing. we had an app that was written in VB to take
specific dates and create an excel file.
I am using the dll in my .NET app but it displays the error while writing
the file...

I am sure that I have used regsrv32 to register the DLL

any suggestions,
Stephen

Aug 8 '06 #4
It looks like your ASP.NET application is not probably not running with
unrestricted CAS permissions (aka full trust). Unless you have restricted
CAS permissions via your own application's web.config file, adjusting this
is a task for the server administrator. (If you are in shared hosting, it's
likely that the administrator will be unwilling to increase your
application's permissions, and you may need to move to dedicated hosting.)
"stephen" <st********@hot mail.comwrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
Hi Kumar and Nicole,

This is how I am working on this project. I have a DLL given to me by
another developer that generates Excel files and he created it using VB6.
I registered it on my box, referenced it and I am trying to use it
This is the error I am getting along with stack trace:

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 .SecurityExcept ion: Permission denied
[SecurityExcepti on: Permission denied]
CBAS_DTStoExcel .CBQueryDTStoEx celClass.set_Ou tPath(Object ) +0
cbas.QueryDB.Ex portToExcel(Dat eTime dBeginDate, DateTime dEndDate) in
C:\Inetpub\wwwr oot\CBAS_Deploy \QueryDB.aspx.v b:74
cbas.QueryDB.bt nRunReport_Clic k(Object sender, EventArgs e) in
C:\Inetpub\wwwr oot\CBAS_Deploy \QueryDB.aspx.v b:53
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108

System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +2112
System.Web.UI.P age.ProcessRequ est() +217
System.Web.UI.P age.ProcessRequ est(HttpContext context) +18

System.Web.Call HandlerExecutio nStep.System.We b.HttpApplicati on+IExecutionSt ep.Execute()
+179
System.Web.Http Application.Exe cuteStep(IExecu tionStep step, Boolean&
completedSynchr onously) +87


"Kumar Reddi" <ku********@gma il.comwrote in message
news:11******** *************@h 48g2000cwc.goog legroups.com...
>you said you are using the COM server DLL directly in .net? If thats
what you are doing.. you need to create an interop assembly before you
can access the methods in that dll

Please let me know if I understoof your question incorrectly

stephen wrote:
>>Hi,
I am getting an error while trying to create an excel file.
"Descriptio n: 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 .SecurityExcept ion: Permission denied"

This is what I am doing. we had an app that was written in VB to take
specific dates and create an excel file.
I am using the dll in my .NET app but it displays the error while
writing
the file...

I am sure that I have used regsrv32 to register the DLL

any suggestions,
Stephen

Aug 9 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
6503
by: Mark Rodrigues | last post by:
Hi everyone, Today we hit a problem when we rolled a new web-site are were presented with a error on our page that looked like: 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.
0
3374
by: James B | last post by:
OMA (Outlook Mobile Access) under Exchange is giving me a System.Security.SecurityException error. From what I gather this is a problem with the security level under which the OMA application is trying to run. Anyone got some ideas on where I can start in getting this worked out? I've posted in Exchange but I'm thinking this group may actually have more ideas. Security Exception Description: The application attempted to perform an...
3
2791
by: Shreeram Natarajan | last post by:
Hello, Iam developing a sharepoint webpart which needs to read data from an excel file. Iam using OleDbconnection for reading data from excel. However using OleDbconnection object gives the following error: "Request Failed: System.Security.SecurityException."
5
1109
by: Jarod_24 | last post by:
How do i prevent getting a System.Security.SecurityException when running my app from a Network Drive? My app stopped when checking for a previous instance of itself using the code: Private Function prevInstance() As Boolean Dim pProcess As Diagnostics.Process() pProcess = Diagnostics.Process.GetProcessesByName(System.Diagnostics.Process.GetCurrent
1
1634
by: eisenb | last post by:
microsoft.public.dotnet.languages.vb.upgrade isn't getting much traffic, so I'll try here. Ours is a VB6 shop exploring .NET. First I wrote a new application with VB .NET 2003 to create a pdf Crystal Report from a SQL Server 2000 table. I followed advice from the MSDN article "Add Professional Quality Reports to Your Application with Visual Studio .NET" (http://msdn.microsoft.com/msdnmag/issues/02/05/Crystal/), and it
3
10450
by: steveeisen | last post by:
microsoft.public.dotnet.languages.vb.upgrade isn't getting much traffic, so I'll try here. Ours is a VB6 shop exploring .NET. First I wrote a new application with VB .NET 2003 to create a pdf Crystal Report from a SQL Server 2000 table. I followed advice from the MSDN article "Add Professional Quality Reports to Your Application with Visual Studio .NET"
0
2155
by: Siberwulf | last post by:
I'm trying to fetch an XML document from a website through an assembly i built and attached to SQL 2005. Here is my code for the SPROC assembly: public static void fetch_FeedData(string m_URL) { SqlPipe p = SqlContext.Pipe;
4
1777
by: confused1234 | last post by:
I get the error at the bottom of this post when i click on a linkbutton, javascript:__doPostBack('ctl00$Main$btnchangeemail','') The problem is intermitant, sometimes it works and sometimes it errors, The page is running in an iframe if this makes a difference. ANY IDEAS??? Thanks
1
9259
by: starrysky | last post by:
Trying to read key "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" value "AUOptions" and get the following : A first chance exception of type 'System.Security.SecurityException' occurred in mscorlib.dll Error occurs in ReadRegistry key SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU : Requested registry access is not allowed. This occurs in my vb.net application when application is run under an account called OPER in...
0
9865
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9706
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10932
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10609
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10303
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7851
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7025
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5692
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.