Prevent VS 2005 from trying to parse media files

R

Robert Dunlop

I am using Microsoft Visual Studio 2005 for development of an ASP.NET site,
and I have a problem that greatly effects my workflow at times. It seems
that after I upload new files anywhere within the directory structure of the
site that is visible to VS, the next time I perform a build VS takes extra
time, apparently downloading the new files (though the time required seems
much longer than a one-time download should take). During this time VS
appears to be hung, the only way to cancel the build is to close VS through
task manager. As the site includes some rather large media files, this can
sometimes mean I have to walk away for several hours while I let VS do its
thing.

What causes this, and is there a way to prevent it? Usually I am uploading
the media files through FTP, maybe I should upload them through the IDE so
VS doesn't feel it needs to examine these new files? I don't find them
anywhere in the local cache for the project, so it doesn't seem that they
are downloaded to update the local copy of the project. The files involved
are media files with extensions unrelated to a build, so if not for caching
why is it reading these files?

I find an option for excluding a file from the project, but this renames the
file with a .exclude extension, which I don't find to be an acceptable
option. Is there maybe an element that I could include in a web.config file
to configure a directory to be ignored by the compiler? Or something buried
in the VS settings?


Presently, I've been waiting over an hour to compile a 2 line change to a
..cs file, arrgggh! Help!
 
R

Robert Dunlop

Looking into the problem further, I ran SysInternal's FileMon, and found
that VS is busy writing a bunch of temp files to C:\Documents and
Settings\Administrator\Local Settings\Temp. Since the build started (it's
still running) there have been 56 files created with names in the form of
ISPxxx.TMP, where "xxx" is a sequential three digit hexadecimal number.
Opening some of them, they are copies of files from the web site. Currently
these files are over 1 gigabyte in total size, which would explain the time
it's taking. They include six Flash video files (.flv extension) that are
150MB-200MB each, even though the only file I had updated externally since
the previous build is a 2MB flash application.

Any ideas?
 
J

John Saunders

Robert Dunlop said:
Looking into the problem further, I ran SysInternal's FileMon, and found
that VS is busy writing a bunch of temp files to C:\Documents and
Settings\Administrator\Local Settings\Temp. Since the build started (it's
still running) there have been 56 files created with names in the form of
ISPxxx.TMP, where "xxx" is a sequential three digit hexadecimal number.
Opening some of them, they are copies of files from the web site.
Currently these files are over 1 gigabyte in total size, which would
explain the time it's taking. They include six Flash video files (.flv
extension) that are 150MB-200MB each, even though the only file I had
updated externally since the previous build is a 2MB flash application.

A man goes to his doctor. He says, "Doctor, it hurts when I use a Web Site",
so the doctor says, "So, don't _use_ a Web Site, use a Web Application
Project, since it doesn't assume that every file in the same folder as the
project is a part of the project that needs to be built".

Now, having used the word "built", I wonder if it's somehow possible to
remove the builders for those file extensions? But, again, I don't know,
because I don't use Web Site "projects".

I was hoping that my unpleasant remarks about Web Site "projects" would
cause a reply from someone who knows them better than I do. Perhaps my
Groucho Marx imitation will do the same.

;-)
 
B

bruce barker

it has nothing to do with being a web site. when a build is done, asp.net is
called to do a compile (with an application proj, the code behinds are
compiled first, then the asp.net compiler called to compile evertyhing else).
if you remove a build step in a web application, then the asp.net compiler is
used instead. the only way to exclude a file is to make the extension
..exclude

with vs, instead of building in place, all files in the website are copied
to a temp folder except those that vs compiel (then its just the output
dll's), and then the asp.net compiler is called. the asp.net compiler
actually has its own temp folder that the compiler output goes to. the dev
webserver reads from this temp area.

in your case the one approach is not not use the dev web server. use iis
instead. then compiles can happen in place, so media will not be copied. you
may need to set vs to not build before running and you can still debug.

another approach is to move the media to another vdir so its does not effect
the build.

-- bruce (sqlwork.com)
 
J

John Saunders

bruce barker said:
it has nothing to do with being a web site. when a build is done, asp.net
is
called to do a compile (with an application proj, the code behinds are
compiled first, then the asp.net compiler called to compile evertyhing
else).
if you remove a build step in a web application, then the asp.net compiler
is
used instead. the only way to exclude a file is to make the extension
.exclude

with vs, instead of building in place, all files in the website are copied
to a temp folder except those that vs compiel (then its just the output
dll's), and then the asp.net compiler is called. the asp.net compiler
actually has its own temp folder that the compiler output goes to. the dev
webserver reads from this temp area.

in your case the one approach is not not use the dev web server. use iis
instead. then compiles can happen in place, so media will not be copied.
you
may need to set vs to not build before running and you can still debug.

another approach is to move the media to another vdir so its does not
effect
the build.

Bruce, it seems there are several questions here; perhaps you can help the
OP understand. Also, other developers on my team are experiencing much
longer build times today, after our servers were moved to another state.
This may be related to their problem as well.

One question for the OP: what is the file extension of the media files being
built?
Bruce, given that answer, I hope you will be able to help identify which
"builder" is building those particular files.

In my case, we all use Web Application Projects, and I had never noticed
this behavior before. Were you talking about something that happens during
the use of the Build command (as the OP seems to have been asking), or are
you referring to the build that happens at run-time, once the web
application has been deployed? I've never noticed an IDE or MSBUILD build
doing anything with media files other than copy them if their build type is
set to "Content". Can you say which task or target is used for this step?
That would help me find it in the rather large Detailed MSBUILD log I have.
I just searched it for "aspnet_", and don't see it there.
 
R

Robert Dunlop

John Saunders said:
Bruce, it seems there are several questions here; perhaps you can help the
OP understand. Also, other developers on my team are experiencing much
longer build times today, after our servers were moved to another state.
This may be related to their problem as well.

One question for the OP: what is the file extension of the media files
being built?
Bruce, given that answer, I hope you will be able to help identify which
"builder" is building those particular files.

There are a number of different file formats that have triggered this
behavior:

..flv (Flash video)
..swf (compiled Shockwave Flash application)
..mp3 (MPEG layer 3 audio)
..pdf (Adobe PDF documents)

It seems to me that any files added are triggering this behavior, I noticed
those simply because they are big and have a major impact at build time.
And as I noted before, this is a one time thing, once I let it work through
the long build it doesn't occur again until I add or modify a media file
(which is pretty often right now). Then VS reads the whole web site the
next time I select "Build" -> "Build Solution", or any other build type for
that matter. If I haven't made any changes to media files since the last
build, the build process is nice and quick.
In my case, we all use Web Application Projects, and I had never noticed
this behavior before. Were you talking about something that happens during
the use of the Build command (as the OP seems to have been asking), or are
you referring to the build that happens at run-time, once the web
application has been deployed? I've never noticed an IDE or MSBUILD build
doing anything with media files other than copy them if their build type
is set to "Content". Can you say which task or target is used for this
step? That would help me find it in the rather large Detailed MSBUILD log
I have. I just searched it for "aspnet_", and don't see it there.

I increased the output options in settings to detailed, and it seems this is
occurring in some initial step labeled "Validating Files" or some such (I'll
post back with the exact message next time I build), which is where the time
is spent. Once that is complete I get messages from the actual build
process, which in itself takes little time. So I don't think it is really
trying to compile these files, rather it is something to do with a cache
refresh or some such... yet these files never make it to any locally cached
copy that I can find (aside from temporary internet file folder, while this
"validation" is happening). The only files locally cached are those which
actually should be used in the compile (.cs, .aspx, .dll, etc). Which leads
me to wonder how it knows not to read these files on subsequent builds....
Maybe there is some way I could trick it into not reading them, if I knew
where such information was held?

One final note, the site is co-hosted at GoDaddy, so I don't have much in
the way of options when it comes to making adjustments to IIS, creating
vdirs, etc.

Another thought that I have had is that maybe this is a VS2005 quirk that I
am saddled with. I do have VS 2008 Express installed, should I consider
trying that out, if so are there any migration issues I should be ready for?

Thanks Bruce and John for your attention to this issue, I've been dealing
with this issue for a while but it's finally reached a critical point where
it is effecting my ability to perform... hopefully there is a solution out
there...
 
J

John Saunders

Robert Dunlop said:
I increased the output options in settings to detailed, and it seems this
is occurring in some initial step labeled "Validating Files" or some such
(I'll post back with the exact message next time I build), which is where
the time is spent. Once that is complete I get messages from the actual
build process, which in itself takes little time. So I don't think it is
really trying to compile these files, rather it is something to do with a
cache refresh or some such ....
Another thought that I have had is that maybe this is a VS2005 quirk that
I am saddled with. I do have VS 2008 Express installed, should I consider
trying that out, if so are there any migration issues I should be ready
for?

I don't know of any migration issues. If you were using Web Application
Projects (or any project, for that matter), then there's a trivial "upgrade"
required to the project files, to specify that the V3.5 tools should be
used. That's the kind of upgrade I've taken care of with the "Replace in
Files" command.

Are you running VS2005 SP1? If not, then I might try that first, just to see
if this is a bug they fixed.

Also, see this blog post:
http://weblogs.asp.net/scottgu/arch...b-Project-Build-Performance-with-VS-2005.aspx. I
found it during the following search:
http://social.msdn.microsoft.com/Search/en-US/?query=ASP.NET build solution web site&ac=8.

I didn't have time to go through the 150,000 hits, but there were some
interesting ones in the first few pages. Take a look and see if one helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,034
Messages
2,570,356
Members
47,002
Latest member
RobertoLip

Latest Threads

Top