Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / October 2004

Tip: Looking for answers? Try searching our database.

Why is opening a text file so slow?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tim Werth - 12 Oct 2004 16:27 GMT
I have a .NET solution with about 25 projects in it.  When I am working in
that solution and open a text file which happens to not be part of the
project, it takes ~50 seconds to open.  The text files I am opening are not
big at all, maybe 50 lines max.  Why does this take so long?

Tim
Gary Chang[MSFT] - 13 Oct 2004 06:41 GMT
Hi Tim,

> I have a .NET solution with about 25 projects in it.  When I am working in
> that solution and open a text file which happens to not be part of the
> project, it takes ~50 seconds to open.  The text files I am opening are not
> big at all, maybe 50 lines max.  Why does this take so long?

When this behavior would happen, just after the time when you open that
solution, or anytime when you try to load that small text file?

If you load the text file just after opening the big soluiton, the VS.NET
may process your solution information at the same time.

I suggest you can use the SysInternals' FileMon to trace what the VS.NET is
doing during that about 30 seconds time...
 

Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Tim Werth - 13 Oct 2004 15:51 GMT
This happens at any time.  Typically, this is what I do:  When I first login
in the morning, I'll bring up my managed C# solution that resides on X: (a
subst drive that really exists on my physical drive D:).  Opening the
solution itself takes at least 2 minutes.  I attribute this to VSS
integration, but I am not positive.

I write code, debug, and whatever else thoughout the day.  Once I have built
the project, I have several .BAT files on C: that I use to help copy the
resultant DLL, EXE, .config,... files from X: to where they will be run on
C: .  I copy the files because I have found the CLR doesn't like running
code on substituted drives (security/permission errors).  If I have to
modify one of those .BAT files that is not part of the solution nor has it
been checked into VSS, I open the text file in VS.NET for editing.  This is
when it takes a long time.

A coworker just tried it with the same C# solution that I work on and it
took ~25 seconds on his machine each time he opened the same file.

Opening the same file in another unmanaged C++ solution that is comprised of
just 1 project opens almost instanteously on my box and his.

Here is something else I have just noticed.  If the file that is not part of
the solution is opened, I have to wait 50 seconds.  If I then close it and
reopen it, it takes another 50 seconds to open it the second time.  But, if
I have one non-project file already opened (that I had to wait 50 seconds
for), any subsequent opening of any other file that is not part of the
solution is instanteous.

The files that I am opening do not have to be .BAT files or even text files.
I see the problem when I opened a .CPP file from another solution.

Tim
Gary Chang[MSFT] - 15 Oct 2004 07:20 GMT
Hi Tim,

Your scenario seems a little complicated... currently we are perform some
research on it.
We will reply here with more information as soon as possible.

Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Dat Bui [MSFT] - 19 Oct 2004 16:22 GMT
Hi Tim,

    I understand that you have 25 projects in an SLN, on a subst drive
that is checked in VSS.  Opening any files not in the projects opens with a
delay of ~50 sec, right?

Please try this to see if the problem happens:
1.  Create a new project on c:\ and try to open a file outside the project
and see?

    You tested with an unmanaged C++ proejct and open up a file not in the
project and it opens instantaneously.  I have some follow up questions:
    1.  is this c+ proecjt on the subst drive?
    2.  is it checked into source control?
    3.  if any of the above  is no, can you try adn create a new project
adn set it up the same way as the first scenario adn test to see if it
repros?

Also, here are somethings that might cause the problems that you can check:
1.  Check to see if you have any addins installed:  Tools->Addin Manger
    Usually addins do not fully integrate with the IDE so can cause some
problems.
2.  Antivirus software, it can delay the loading of files, so you can try
and disable antivirus
3.  Try running filemon and check to see what is holind up the loading of
the file.  Here is a link to get it with instructions:
    http://www.sysinternals.com/ntw2k/source/filemon.shtml
    a.  you can zip up the txt file the log generated and attach it to
this thread and I can help look at it

By the way, I noticed that you mentioned your batch file is used to copy
the built assemblies to a specfic location.  Since you are using VS.Net
2003, there is a feature added called pre and post build steps.  Here is a
good location for you to add the copy steps on a post-build event.  I do
not know if you are awrae of this.  this will make your project more
portable and not dependent on the bat file.  I have included some steps
below that will illustrate:

Build Events, Common Properties, <Projectname> Property Pages Dialog Box
http://msdn.microsoft.com/library/en-us/cscon/html/vcurfcustombuildeventscom
monpropertiesprojectnamepropertypagesdialogbox.asp?frame=true

Here is how you can set commands to copy to a common directory:
    a.  Create a shared common directory, and in that directory, create
subdirectories that correspond to the type of configuration you may have,
debug, release, etc...
    b.  Then in the Post Build Event, add the following command:
          xcopy /s /y "$(TargetDir)$(ProjectName).*" "c:\Common
Directory\$(ConfigurationName)\"
          //////I use double quotes on all paths just incase there is a
space in the directory name, or you can add commands from your bat file
    c.  This command will copy all project files to the correct directory
depending on the build configuration name.
    d.  a temporary bat file will be located in the projects build
directory that you can view and edit

Hope this helps,
Dat Bui
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
? Microsoft Corporation.  All rights reserved.

--------------------
>Reply-To: "Tim Werth" <twerth@onlineziimaging.com>
>From: "Tim Werth" <twerth@onlineziimaging.com>
>References: <eE#EKAHsEHA.1992@TK2MSFTNGP09.phx.gbl>
<fNaNSdOsEHA.768@cpmsftngxa10.phx.gbl>
>Subject: Re: Why is opening a text file so slow?
>Date: Wed, 13 Oct 2004 09:51:56 -0500
[quoted text clipped - 8 lines]
>NNTP-Posting-Host: ckpnt02.intergraph.com 63.75.137.129
>Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09
.phx.gbl
>Xref: cpmsftngxa10.phx.gbl microsoft.public.vsnet.ide:14127
>X-Tomcat-NG: microsoft.public.vsnet.ide
[quoted text clipped - 31 lines]
>
>Tim

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.