473,671 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Program runs fine on my computer, won't run on end user computers

I've got an application that I've written in C# that reads and writes to the
filesystem. On the computer I developed the application on, everything works
properly. If I try to run it on another computer that has the .NET 2.0
framework installed but not the SDK, it throws a
system.io.filen otfoundexceptio n the moment it tries to access the filesystem,
even though it does a File.Exists() check before every access.

I've talked to some friends who are professional .NET developers, and they
suspect it's related to Code Access Permissions, but I can't figure out how
I'm supposed to get this assembly trusted on a user's computer when I don't
have mscorcfg.msc or caspol.exe. I'm not going to install the SDK on every
computer that uses the application, and the application is useless without
filesystem access. What should I do?
Feb 25 '06 #1
2 2263
"=?Utf-8?B?RG91ZyBTdHJ laWZlbA==?=" <Doug
St******@discus sions.microsoft .com> wrote in
news:67******** *************** ***********@mic rosoft.com:
I've got an application that I've written in C# that reads and
writes to the filesystem. On the computer I developed the
application on, everything works properly. If I try to run it
on another computer that has the .NET 2.0 framework installed
but not the SDK, it throws a system.io.filen otfoundexceptio n the
moment it tries to access the filesystem, even though it does a
File.Exists() check before every access.

I've talked to some friends who are professional .NET
developers, and they suspect it's related to Code Access
Permissions, but I can't figure out how I'm supposed to get this
assembly trusted on a user's computer when I don't have
mscorcfg.msc or caspol.exe. I'm not going to install the SDK on
every computer that uses the application, and the application is
useless without filesystem access. What should I do?


Doug,

From what you've described, I would agree with those other .Net developers.

Code Access Security (CAS) is one of the seemingly mysterious aspects of
..Net. In reality, it's not that hard once you get the hang of it.

This MSDN TV video gives a very good grounding in what CAS is and how it
works. It's only about 13 minutes long, and the examples in the program
use file system permissions to explain CAS:

http://msdn.microsoft.com/msdntv/epi...l/manifest.xml

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Feb 25 '06 #2
"Doug Streifel" <Doug St******@discus sions.microsoft .com> wrote in message
news:67******** *************** ***********@mic rosoft.com...
I've got an application that I've written in C# that reads and writes to
the
filesystem. On the computer I developed the application on, everything
works
properly. If I try to run it on another computer that has the .NET 2.0
framework installed but not the SDK, it throws a
system.io.filen otfoundexceptio n the moment it tries to access the
filesystem,
even though it does a File.Exists() check before every access.
File.Exists should return false your application lacks CAS permissions to
access the file location, so the problem seems may not be purely
CAS-related. Might you be able to post a code extract (incl. the
File.Exists call) that shows how you are attempt to access the files? Also,
could you please post the full exception details (incl. call stack listing),
as returned from its ToString method?

I've talked to some friends who are professional .NET developers, and they
suspect it's related to Code Access Permissions, but I can't figure out
how
I'm supposed to get this assembly trusted on a user's computer when I
don't
have mscorcfg.msc or caspol.exe.
Caspol.exe is installed with the core framework, and it should be present on
all the client machines. It's only the mscorcfg.msc UI that comes only in
the SDK.

I'm not going to install the SDK on every
computer that uses the application, and the application is useless without
filesystem access. What should I do?


First, let's make sure that the problem really is related to CAS. If it is,
you might want to consider deploying it as a ClickOnce application, if
appropriate. If not, it is quite possible to modify CAS policy on machines
that do not have the SDK installed, but you might want to hold off on
worrying about that for now since it might not be necessary.
Feb 27 '06 #3

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

Similar topics

17
3997
by: los | last post by:
Hi, I'm trying to create a program similar to that of Google's desktop that will crawl through the hard drive and index files. I have written the program and as of now I just put the thread to sleep for 1 second after indexing a couple of files. I'm wondering if anyone knows of a way that I could make so that the program will run at full speed only runs after the computer has been idle for a while. I've looked at the "nice" command...
5
5046
by: Jeff | last post by:
I wrote a simple VB.NET program that runs on a computer ONLY if I install Visual Studio 2003 on that computer. The computer already had .NET Framework 1.1 installed. If it is run on a computer without VS, I get an unhandled exception error trying to start the program. I obviously cannot install VS .NET on all the computers that need to run this program. Any ideas on what is missing from the computers that VS .NET installs that makes the...
8
5389
by: drose0927 | last post by:
Please help! I can't get my program to exit if the user hits the Escape button: When I tried exit(EXIT_SUCCESS), it wouldn't compile and gave me this error: Parse Error, expecting `'}'' 'else if (choice == 27) exit(0) } }' Here is my program (Simple loop to display currency equivalencies based
11
3955
by: bart | last post by:
Hello, I'm so sorry, but i don't understand the concept of the .net environment yet. I made a simple program that retrieves the hostname and ipaddress of the local computer. But when i give thit .exe file to my friend he can't run it because he does not have the framwork 1.1 I thought that the this framework is just a large library of classes wich
2
11458
by: William LaMartin | last post by:
I have created a program that allows for the automation of things in Word documents, like changing the values of DocVariables and the links to Excel Sheets. I did it using interoperoperatability, where, after adding a reference to Microsoft.Office.Core and a reference to Microsoft Word I declare objects as follows: Dim oWordApp As New Microsoft.Office.Interop.Word.Application, . Everything works fine on the development computer...
2
2487
by: HC | last post by:
Hello, Folks. I am not sure if this can be done (and a brief search of this group didn't yield any results that I thought would do the trick) but if it can be done it would make my life easier so here goes. First, what I am trying to accomplish is to make a program I've written automatically update itself if there is a newer version on the network. Second, my application runs on one or more computers at many geographically separated...
43
3413
by: davidkoree | last post by:
I mean not about cookie. Does it have something to do with operating system or browser plugin? I appreciate any help.
1
1820
by: Luc The Perverse | last post by:
Hello! You may remember me as the guy who's trying to learn C# and using that old version 2003 of visual studio. (Although free version of command line .NET compiler is available, so if some new feature would greatly simplify my life, then I am not opposed) I currently have an application that is single threaded that does batch work (you pass it a file in the command line, it runs for 2-45 minutes and spits out another file). I do not...
0
8392
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
8819
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
7428
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6222
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
5692
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
4222
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
4403
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2809
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2049
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.