|
-
Oct 14th, 2004, 05:43 PM
#1
Thread Starter
Banned
what file ??? permissions huh ???
Trying to send Outlook tasks from asp/vb.net web app and I have this:
VB Code:
Imports Microsoft.Office.Interop.Outlook
Public Class WebForm1
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim objOutlook As Microsoft.Office.Interop.Outlook.Application
Dim objTask As TaskItem
objOutlook = New Microsoft.Office.Interop.Outlook.Application
objTask = objOutlook.CreateItem(OlItemType.olTaskItem)
objTask.Recipients.Add("ssmith")
objTask.Subject = "Test"
objTask.Body = "This is the body"
objTask.Assign()
objTask.Send()
End Sub
End Class
But right when i say objOutlook = New....
I get an error:
Code:
Exception Details: System.UnauthorizedAccessException: Access 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 access.
I tried everything...What the hell is this error. What file????!?!?!?
I tried to go to the reference itself:
C:\Program Files\Microsoft Office\OFFICE11\MSLOut.olb
I right clicked and added every frigging user in our company ...still no luck...gave them write permissions and everytihng...
I need to get this to work so badly please guys help!!!!
Just need to send outlook tasks from asp.net/vb.net to a user.
-
Oct 14th, 2004, 07:13 PM
#2
PowerPoster
Did you add the (machinename)\ASPNET account? or the (machinename)\Network Service account?
You said you added every user in the company, but did you add those?
The reason this is happening is that the ASP.NET worker process has VERY limited permissions on what it can do. You have to specifically let the asp.net worker process access untrusted resources on the network. So, in this case it is trying to access some COM components that are not a trusted resource that ASP.NET can access.
-
Oct 14th, 2004, 07:32 PM
#3
Thread Starter
Banned
Originally posted by hellswraith
Did you add the (machinename)\ASPNET account? or the (machinename)\Network Service account?
You said you added every user in the company, but did you add those?
The reason this is happening is that the ASP.NET worker process has VERY limited permissions on what it can do. You have to specifically let the asp.net worker process access untrusted resources on the network. So, in this case it is trying to access some COM components that are not a trusted resource that ASP.NET can access.
Hmm if I am local on my machine on an xp box i dont have that ASPNET user...
Should I just do this on the windows server?
have you done anytihng like this before hell?
That sounded weird :-).
If you have created tasks or anything from ASP.net can you please give me some direction. I will talk to admins tomorrow to do what you have stated.
Thanks again man
Jon
-
Oct 14th, 2004, 11:59 PM
#4
Originally posted by jhermiz
Hmm if I am local on my machine on an xp box i dont have that ASPNET user...
What about NETWORK SERVICE?
-
Oct 15th, 2004, 06:56 AM
#5
Thread Starter
Banned
Originally posted by mendhak
What about NETWORK SERVICE?
Where what how ?????
-
Oct 15th, 2004, 07:01 AM
#6
Thread Starter
Banned
Originally posted by mendhak
What about NETWORK SERVICE?
Locally on my machine I added that NETWORK SERVICES and gave it FULL permissions
I still get:
Access is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access 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 access.
-
Oct 15th, 2004, 10:08 PM
#7
PowerPoster
Originally posted by jhermiz
Locally on my machine I added that NETWORK SERVICES and gave it FULL permissions
I still get:
Access is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access 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 access.
The message is displaying exactly what you need to do:
{MACHINE}\ASPNET
or
IUSR_MACHINENAME
If you are on Windows XP Pro, there is a ASPNET account that is local to the machine. This is the one you need to let access it. Don't confuse it with the domain accounts, those are completely different. So if your machine name was MyComputer, then you need to add MyComputer\ASPNET as an authorized to execute.
-
Oct 16th, 2004, 10:31 AM
#8
Thread Starter
Banned
Originally posted by hellswraith
The message is displaying exactly what you need to do:
{MACHINE}\ASPNET
or
IUSR_MACHINENAME
If you are on Windows XP Pro, there is a ASPNET account that is local to the machine. This is the one you need to let access it. Don't confuse it with the domain accounts, those are completely different. So if your machine name was MyComputer, then you need to add MyComputer\ASPNET as an authorized to execute.
Hells....
As I said I have done this over and over....
I still get this error.
Here to prove it first off I right clicked that app (shared folder inside inetpub wwwroot).
Went to the sharing tab here is what it has:
Ok it has THOSE accounts...
Then I went to the security tab...please look....
Im just trying to do this locally first....
I get that SAME error I posted before...
Ive posted my code...all it is is a simple TASK...this works in VB.net alone but DOES NOT work in ASP.net (even though the code behind is inside VB.net.
Can anyone please help!
-
Oct 16th, 2004, 02:53 PM
#9
Thread Starter
Banned
Anyone ?
Has anyone done this ?
No responses from anyone anywhere, I just cannot believe no one has EVER had to integrate outlook with ASP.net ???
Come on folks please im begging right now!
-
Oct 16th, 2004, 10:22 PM
#10
PowerPoster
But did you add the aspnet account access to this folder:
C:\Program Files\Microsoft Office\OFFICE11\MSLOut.olb
or anything else that that olb accesses?
-
Oct 16th, 2004, 10:25 PM
#11
PowerPoster
Originally posted by jhermiz
Ive posted my code...all it is is a simple TASK...this works in VB.net alone but DOES NOT work in ASP.net (even though the code behind is inside VB.net.
Can anyone please help!
The reason it works in a windows forms app is because you are running that windows forms app as the logged in user, which is you. You have permission to access all the files. When you do this from ASP.NET, the user isn't you, it is ASPNET that is trying to do the work. The ASPNET account doesn't have all the permissions you have. There is a lot to this that you are just trying to skirt around. You really have to learn this stuff in order to be effective.
-
Oct 16th, 2004, 11:17 PM
#12
Thread Starter
Banned
Originally posted by hellswraith
The reason it works in a windows forms app is because you are running that windows forms app as the logged in user, which is you. You have permission to access all the files. When you do this from ASP.NET, the user isn't you, it is ASPNET that is trying to do the work. The ASPNET account doesn't have all the permissions you have. There is a lot to this that you are just trying to skirt around. You really have to learn this stuff in order to be effective.
Learn this stuff ?????
Im not trying to praise myself but I write solid code ...
and BARELY anyone in the asp.net forums can even understand what I usually am looking for. I dont think there is a single forum that has answers to any asp problems. Most people just guess, it is RIDICULIOUS...sorry for the complaining but just look at this thread no one can give a GOOD solid answer. Everything is "did you check this" " i dunno try this"...
It may not be any ones fault...I just dont think that .net at least via asp.net is straightforward, in fact this whole gosh darn frame work is a piece of sh**
-
Oct 16th, 2004, 11:22 PM
#13
Thread Starter
Banned
Originally posted by hellswraith
But did you add the aspnet account access to this folder:
C:\Program Files\Microsoft Office\OFFICE11\MSLOut.olb
or anything else that that olb accesses?
Yes I gave WRITE / READ / EXECUTE every gosh damn permission to that file too...I still get the Access is denied error.
Doesnt anyone have a frigging step by step way to do this...
So frustrating...
Anyone else with ideas ?
Hells thanks for being patient with me.
-
Oct 16th, 2004, 11:36 PM
#14
Thread Starter
Banned
hells,
Is the rest of my code right ?
Am I approaching this right ?
Do you have a sample you can post and tell
me exactly what you did? I just need to send tasks
from asp.net (outlook tasks). I've exhausted myself
through google, yahoo, MSDN, God knows where else...
Im trying to get this to work and it's just irritating me!
-
Oct 16th, 2004, 11:48 PM
#15
-
Oct 17th, 2004, 04:49 AM
#16
Im not trying to praise myself but I write solid code ...
and BARELY anyone in the asp.net forums can even understand what I usually am looking for. I dont think there is a single forum that has answers to any asp problems. Most people just guess, it is RIDICULIOUS...sorry for the complaining but just look at this thread no one can give a GOOD solid answer. Everything is "did you check this" " i dunno try this"...
They are providing suggestions in where you can look to try & track down the problem & are still helping even if no-one but you has come across this error.
I used the following solution when I had this issue with Microsoft Word & Excel.
1) Goto the windows start menu & enter dcomcnfg.
2) At the applications tab, & double click on the "Microsoft word document" to enter this selection's properties.
3) Set the authentication level to connect on the 1st tab.
4) Set each of the permissions under the security tab to include access for the above-mentioned accounts.
5) Set the Tools>macro>macro security inside of the application to low.
Now I noticed that whilst in this applications list under the dcomcnfg tool that there was no specific "microsoft outlook mail" entry, so this is another "try" suggestion.
There are 2 listed appliactions which start with "Outlook" under this list which I would set the permissions of. If this doesn't help, then I would go under the default properties & default security tabs of the dcomcnfg tool & set these to allow access as a test. As this allows these user accounts access to run more-or-less any application on your computer, I would make a note of the current settings so you can change this back at a later date.
Let me know if just the later suggestion fixed your probelm & I can look into which individual outlook application you should need to set.
-
Oct 17th, 2004, 04:52 AM
#17
As a side note, it was unclear how you were destroying your outlook object, but make sure you use the following code to completely destroy the reference:
VB Code:
objOutlookApp.quit
System.Runtime.InteropServices.Marshal.ReleaseComObject(objOutlookApp)
objOutlookApp = nothing
-
Oct 17th, 2004, 11:11 AM
#18
Thread Starter
Banned
Alex,
What tabs are you talking about ????
When I type in what you stated I get component services, with absolutely NO tabs. I see component services, event viewer, and
services (local). SO where you are getting this I dont see...
Jon
-
Oct 17th, 2004, 01:58 PM
#19
Thread Starter
Banned
I looked at the security alerts in Component Services.
For the event viewer under security I see this:
Event Type: Error
Event Source: DCOM
Event Category: None
Event ID: 10003
Date: 10/17/2004
Time: 12:21:01 AM
User: EARTH\ASPNET
Computer: EARTH
Description:
Access denied attempting to launch a DCOM Server using DefaultLaunchPermssion. The server is:
{0006F03A-0000-0000-C000-000000000046}
The user is ASPNET/EARTH, SID=S-1-5-21-1645522239-602609370-839522115-1007.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Ok...So what does this mean...and how do I fix this ???
-
Oct 17th, 2004, 07:28 PM
#20
PowerPoster
So, is the computer you are running the app on called 'EARTH'?
If so, then why isn't the EARTH\ASPNET account given permissions to that object?
In the images you shown below, you show the D900176\ASPNET account, but not the EARTH\ASPNET one? Is this your problem?
The last thing I can offer you is to map your ASPNET account to use a real user account on your network. Certain things like exchange won't work unless they are being used by a Active Directory user. The local ASPNET account to the machine it is running on usually isn't part of Active Directory.
When I tell you that you need to learn this stuff, I am not attacking your code at all. I am attacking your knowledge of network security and how the ASPNET user is mapped and used on the local machine and box. I don't really care how solid your code is, if the network won't allow a process to do something, you are stopped right there. You need to figure out the permissions to allow it to do it.
As far as no one here knowing the exact steps...come on, you are acting a little childish. We are trying to help you in any way we can. We may have never done exactly what you are doing, but we have done similar things. I have no more advice to offer you, so good luck.
-
Oct 24th, 2004, 07:12 PM
#21
PowerPoster
You never replied on this...did you ever get it fixed? If so, I would like to know what it was so that if anyone else ever has this problem I can pass off the answer to them.
-
Oct 24th, 2004, 11:47 PM
#22
Thread Starter
Banned
Originally posted by hellswraith
You never replied on this...did you ever get it fixed? If so, I would like to know what it was so that if anyone else ever has this problem I can pass off the answer to them.
I scraped that entire idea, waste of time on it...besides its a web based application and the task needed to be sent on the client side.
I decided to come up with a better solution. Writing an active x control in vb6 (COM) and dropping it on the web page. That way I could use VBScript or JScript to call the object and it would run on the client side .
Currently cleaning up the code but it works a treat and its over the web...and guess what I CAN SEND TASKS IN ASP.NET :-)
Jon
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|