473,545 Members | 2,049 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem writing to network drive, visual studio 2005 service pack 1

Bob
Hi,
I have some very simple code that I have been using for quite a while
that uses a streamwriter to write to a network file. I have never had
any problems with it. I recently updated Visual Studio 2005 with
Service Pack 1 and now it gives me the "Directory not found "
exception when I try to write to a network location. I am running it
on Vista as a standard user. However, I have opened Visual Studio
using the "run as administrator". The program still works fine when I
run it with Visual Studio c#. The code throwing the exception is:
using (StreamWriter sw = new StreamWriter(in pFileName)). How can I
fix this?

Thanks,
Bob

Aug 1 '07 #1
5 2505
* Bob wrote, On 1-8-2007 11:16:
Hi,
I have some very simple code that I have been using for quite a while
that uses a streamwriter to write to a network file. I have never had
any problems with it. I recently updated Visual Studio 2005 with
Service Pack 1 and now it gives me the "Directory not found "
exception when I try to write to a network location. I am running it
on Vista as a standard user. However, I have opened Visual Studio
using the "run as administrator". The program still works fine when I
run it with Visual Studio c#. The code throwing the exception is:
using (StreamWriter sw = new StreamWriter(in pFileName)). How can I
fix this?

Have you looked in the debugger what the value of inFileName is? Maybe
it's not what you expect it to be.

Jesse
Aug 1 '07 #2
Bob
On Aug 1, 5:13 am, Jesse Houwing <jesse.houw...@ nospam-sogeti.nl>
wrote:
* Bob wrote, On 1-8-2007 11:16:
Hi,
I have some very simple code that I have been using for quite a while
that uses a streamwriter to write to a network file. I have never had
any problems with it. I recently updated Visual Studio 2005 with
Service Pack 1 and now it gives me the "Directory not found "
exception when I try to write to a network location. I am running it
on Vista as a standard user. However, I have opened Visual Studio
using the "run as administrator". The program still works fine when I
run it with Visual Studio c#. The code throwing the exception is:
using (StreamWriter sw = new StreamWriter(in pFileName)). How can I
fix this?

Have you looked in the debugger what the value of inFileName is? Maybe
it's not what you expect it to be.

Jesse
Yes. The file name is what I expect it to be, is listed in the
exception, and the code runs fine in c# express or for writing to
local drives.

Aug 1 '07 #3
On Aug 1, 5:16 am, Bob <bshumsk...@yah oo.comwrote:
I have some very simple code that I have been using for quite a while
that uses a streamwriter to write to a network file. I have never had
any problems with it. I recently updated Visual Studio 2005 with
Service Pack 1 and now it gives me the "Directory not found "
exception when I try to write to a network location. I am running it
on Vista as a standard user. However, I have opened Visual Studio
using the "run as administrator". The program still works fine when I
run it with Visual Studio c#. The code throwing the exception is:
using (StreamWriter sw = new StreamWriter(in pFileName)). How can I
fix this?
I've had this problem too. Basically you're running VS as an admin
user, and its seems to be in some kind of different "context," and the
mapped drive is not available to VS (Vista keeps drives unconnected
until you open them). The solution for me is to open the References
dialog, goto the Browse tab, and type the mapped drive (such as R:\)
and press enter. you'll see the list of files / folders you expect on
the drive. You shouldn't need to do in anymore, unless you log off
your user.

HTH
Andy

Aug 1 '07 #4
Bob wrote:
[...]
>>From your description of the problem it seems like I wouldn't have
this problem if I ran Visual Studio not as an administrator but when I
try to do that it gives me some very frightening error message that my
project "could not be opened because the Microsoft Visual c# 2005
compiler could not be created. Please re-install Visual Studio".
I have been barely following this thread, mainly because the issue is so
foreign to me. It's not something I've ever seen, and so I don't really
have any suggestions for how to fix it.

That said, I can confirm without reservation that Visual Studio 2005
works fine when run without administrator privileges, at least under
Windows XP. You'll want to run it once as an admin, so that it can set
some stuff up, but that's not strictly necessary (I was able to create a
project, compile, and run it all without admin privileges) and you only
have to do it once.

If you are getting some other error running not as an admin, there is
something else unusual going on with your configuration, and your time
would probably be better spent figuring that out.

Of course, on top of all that, I have no good explanation for why your
application cannot use a network drive depending on which user it's run
under. I've never had that issue before, with VS or any other
application for that matter. Drive connections work for me regardless
of user privileges.

Are you running Vista? I'm not, so if you are that could explain why I
haven't run into that sort of thing.

Pete
Aug 2 '07 #5
Bob
On Aug 2, 11:21 am, Peter Duniho <NpOeStPe...@Nn OwSlPiAnMk.comw rote:
Bob wrote:
[...]
>From your description of the problem it seems like I wouldn't have
this problem if I ran Visual Studio not as an administrator but when I
try to do that it gives me some very frightening error message that my
project "could not be opened because the Microsoft Visual c# 2005
compiler could not be created. Please re-install Visual Studio".

I have been barely following this thread, mainly because the issue is so
foreign to me. It's not something I've ever seen, and so I don't really
have any suggestions for how to fix it.

That said, I can confirm without reservation that Visual Studio 2005
works fine when run without administrator privileges, at least under
Windows XP. You'll want to run it once as an admin, so that it can set
some stuff up, but that's not strictly necessary (I was able to create a
project, compile, and run it all without admin privileges) and you only
have to do it once.

If you are getting some other error running not as an admin, there is
something else unusual going on with your configuration, and your time
would probably be better spent figuring that out.

Of course, on top of all that, I have no good explanation for why your
application cannot use a network drive depending on which user it's run
under. I've never had that issue before, with VS or any other
application for that matter. Drive connections work for me regardless
of user privileges.

Are you running Vista? I'm not, so if you are that could explain why I
haven't run into that sort of thing.

Pete
Thanks for your responses. Pete, I have noticed all the problems you
said. The not being able to open a solution by selected it is another
real pain. I really wish I had never upgrade with Service Pack 1!!

Aug 3 '07 #6

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

Similar topics

4
6842
by: marc.gibian | last post by:
I am writing a small Windows Service in C#. It is structured as two C# programs, one, let's call it myAction, that runs as a command line program and a second, let's call it myWrapper, that is the actual windows service, which starts the first program as a child process (and then waits for the child process to terminate, restarting it should...
4
2145
by: sqlguy | last post by:
Why do we have to contact MS for a problem that has been with this compiler from at least the beta of VS 20005. I am so sick and tired of the 30 - 40 clicks it takes to dismiss VS when there is a problem. Can they not just post the fix. I see no reason to contact MS since I have most likely sent about 1500 dumps to them and I would think...
8
6256
by: WT | last post by:
Is it normal that Visual Studio sets the PreInit handler for a Page from the OnInit code ? No chance to fire it as OnPreInit is run befor OnInit. ??? CS
0
2548
by: bernhard.nowara | last post by:
Hello, I found a bug in Visual Basic used with Visual Studio Macros (Microsoft Visual Studio 2005 + SP1). Description: If I apply the simple Visual Basic statement ActiveDocument.Selection.Text = "//" + ActiveDocument.Selection.Text
0
4853
by: =?Utf-8?B?S2FybCBQb3RoYXN0?= | last post by:
According to this page Crystal Reports for Visual Studio 2005 Service Pack 1 should be released soon. Does anyone know the exact release date for this? http://support.microsoft.com/default.aspx/kb/928957 ***from article**** Crystal Reports for Visual Studio 2005 Service Pack 1: Crystal Reports for Visual Studio 2005 Service Pack 1 will be...
4
1547
by: Poldie | last post by:
I'm using Visual Studio 2005 SP1 on a Win2K SP4 system. VS is set up to use "web development settings ". I use VB. If I create a new web application project, then close the project and exit VS I can see many files, including a .sln and a .vbproj file. I can double click on the .vbproj file to load it, or I can load VS and from within VS...
16
1751
by: Bill Nguyen | last post by:
I'm running into a very weird problem regarding subtraction. Subtraction behaves as if it's an addition in the below sub txtJacoCost.Text = Format(mRackc - (mDisc + mJaEc), "0.#####0") txtWfCost.Text = Format(mRackc - mDisc + mWfEC, "0.#####0")
3
1838
by: Rachel Garrett | last post by:
This is driving me mad. I have Visual Studio.NET PRO 2005 installed on my machine at work. I want to write a web service. I find lots of tutorials on how to do this with Visual Studio.NET; some are even Visual Studio.NET 2005. These tutorials all have screenshots of the "Visual Studio Installed Templates" under Visual C#. Here is one...
6
1858
by: Author | last post by:
I have VS 2005 professional. Here is the version info: Microsoft Visual Studio 2005 Version 8.0.50727.762 (SP .050727-7600) &copy; 2005 Microsoft Corporation. All rights reserved. When I try to create a new project, I don't have a web application project option. In the New Project window, I select Visual C# under Project types, and on...
0
7401
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...
0
7656
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. ...
0
7808
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...
1
7423
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5329
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...
0
4945
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...
0
3443
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1884
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
1
1014
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.