Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 19th, 2004, 09:26 AM
Friend of Wrox
Points: 2,876, Level: 22
Points: 2,876, Level: 22 Points: 2,876, Level: 22 Points: 2,876, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default 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?
Reply With Quote
  #2 (permalink)  
Old October 26th, 2004, 12:19 PM
Friend of Wrox
Points: 2,876, Level: 22
Points: 2,876, Level: 22 Points: 2,876, Level: 22 Points: 2,876, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

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?
Reply With Quote
  #3 (permalink)  
Old October 26th, 2004, 03:10 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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?
Reply With Quote
  #4 (permalink)  
Old October 26th, 2004, 03:35 PM
Friend of Wrox
Points: 2,876, Level: 22
Points: 2,876, Level: 22 Points: 2,876, Level: 22 Points: 2,876, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

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?
Reply With Quote
  #5 (permalink)  
Old October 26th, 2004, 03:51 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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?
Reply With Quote
  #6 (permalink)  
Old November 9th, 2004, 05:10 PM
Friend of Wrox
Points: 2,876, Level: 22
Points: 2,876, Level: 22 Points: 2,876, Level: 22 Points: 2,876, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

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?
Reply With Quote
  #7 (permalink)  
Old November 9th, 2004, 05:42 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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.
Reply With Quote
  #8 (permalink)  
Old November 11th, 2004, 04:28 AM
Authorized User
 
Join Date: Jul 2004
Location: Bandar Seri Begawan, Brunei-Muara, Brunei.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

<<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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running MS DTC On Shared Hosting Site learningASP.Net BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 February 4th, 2008 11:08 AM
Help running TBH on Shared Server Luke268 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 October 3rd, 2007 05:02 PM
procedure in Setting upVSS on Shared Network Drive kcheluvaraj VS.NET 2002/2003 1 February 7th, 2006 02:45 PM
SecurityException running .NET from shared drive Ron Howerton General .NET 19 October 21st, 2004 03:20 PM
Running TOMCAT on drive D: du-it JSP Basics 1 August 9th, 2004 07:44 AM



All times are GMT -4. The time now is 05:41 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.