 |
| General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category.
** PLEASE BE SPECIFIC WITH YOUR QUESTION **
When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

October 19th, 2004, 09:26 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
|
|
Email Problem When Running from Shared Drive
I've written MAPI code to send email from my VB.NET Windows application. It works fine when run from a subdirectory on my local hard drive. However, when I copy the program to a shared network drive and run it from there, the program receives this error when it attempts to send the email:
System.Security.Permissions.SecurityPermission
The program appears to execute OK otherwise. So what do I need to do to allow this program to send email from my system when run from a shared network drive?
|
|

October 26th, 2004, 12:19 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
|
|
This is becoming a big problem - this application is supposed to go live on Nov. 15. Does anybody have any suggestions at all on anything worth trying to resolve this?
|
|

October 26th, 2004, 03:10 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Did you add the network shared to the trusted locations for .NET??
To add the network share, open Microsoft .NET Framework 1.1 Configuration, then Runtime Security Policy, then Machine | Code groups and finally the LocalIntranet_Zone
There you can add a Child Code Group that points to your network share. Adding that share makes it trusted by the calling application, eliminating this error (at least, that's what I think).
I can't recall each and every step you need to perform, but I think the terms I have listed here, and the dialogs you'll meet will get you in the right direction.
If I am not mistaken, there is even a recent post about this somewhere on this forum.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Dying Slowly by Tindersticks (Track 1 from the album: Can our love...) What's This?
|
|

October 26th, 2004, 03:35 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
|
|
A couple of questions:
1. This is a WINDOWS application, not an ASP program. Why would I reference the Intranet zone?
2. When I tried this, I was never asked what program was to be trusted. Is it assuming ALL .NET programs are now fully trusted? And does this apply to all machines, or must it be done on each machine individually?
3. The program was compiled in FW 1.0, not 1.1. Changing wizards in 1.1 did not help with my previous security issue - I had to do it in 1.0. However Framework 1.0 Configuration seems to do nothing when I double click it. Which configurator should I run?
|
|

October 26th, 2004, 03:51 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
The .NET Framework uses IE Security Zones for these settings (I think to proof Microsoft's point that IE is everywhere and cannot be separated from the OS ;) )
Basically, you need to trust the folder that contains your application.
To trust an app, I had to add "a condition type for this code group" of URL, with aa path like this:
file://WEBSERVER/MY DOCUMENTS/Visual Studio Projects/MyProject/*
I just mentioned the name of the menu item as it appears on my system. Obviously, you need the 1.0 settings for a 1.0 application.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Aqueanosolo - Aqua Regia by Various Artists (Track 9 from the album: Ambient House - The Compilation By DFC) What's This?
|
|

November 9th, 2004, 05:10 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
|
|
I still have no working solution to this problem. I'm prepared to abandon MAPI if somebody can offer an answer that can be referenced from a WINDOWS based program ([u]not ASP</u>) that will consistently work and which does not require I touch every PC this system has to run on. For example, is there a way to put something on our server that I can call, passing email addresses, subject line and body, and which will send email from that server instead of from the client's machine?
|
|

November 9th, 2004, 05:42 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Did you consider Web services? That allows you to connect from any type of application, like Windows of ASP.NET applications to your server to send an e-mail....
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

November 11th, 2004, 04:28 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
<<However, when I copy the program to a shared network drive and run it from there, the program receives this error when it attempts to send the email:>>
Do you have enough permission on the shared drive?does your PC and the PC where the shared directory have trust to each other?
jrd
|
|
 |