BSCMAKE error BK1505

Hi everybody,

I'm just porting a huge solution (MFC, lot's of DLL subprojects) from VS 2008 to VS 2010, everything compiles and links fine normally, but from time to time the build stops with an error caused by BSCMAKE, something like this:

> BSCMAKE: error BK1505 : cannot read from file '.\Debug\Netlist.bsc'

This project 'Netlist' is quite large (about 400 files, the generated SBR files have about 3,5 GB all together allthough the generated BSC file is just about 11 KB which I think is strange too since in most other projects the BSC files are > 10 MB), but as told in general it builds fine but after some time working with it the error occurs.

The only way to resolve the error I found up to now is to delede the mentioned BSC file - then the next build gives an error like this:

> BSCMAKE : warning BK4502: truncated .SBR file '.\Debug\<filexy>.sbr' not in .\debug/Netlist.bsc
> BSCMAKE : error BK1513: nonincremental update requires all .SBR files

here <filexy> varies from time to time.

After this the next build compiles/links fine without any error.

I tried to find the reason and/or a way to workaround that annoying error which forces me to build the project three times with deleting the BSC file in between, but I cannot find any more info about this then:

> BSCMAKE cannot read from the file.
> To fix by checking the following possible causes
>  1. File corruption.
>  2. File truncation to the compiler running out of disk space or being interrupted while creating the .sbr file.


I have enough free disk space, so this cannot be the cause - sometimes I interrupt the build process, but I don't think this is the cause since mostly the error occured even after I built some times without interrupting.

And, I never encountered the same problem with VS 2008 ...

I know I can avoid this problem by either disabling browse info at all (but I don't want to do this) or by passing the option '/n' to BSC make, but this will cause a full rebuild of browse info and this consumes quite a lot of time.

Now I want to ask if anyone of you had similar problems and probabyl found another workaround ...

Thanks in advance,

LVL 31
Who is Participating?

Improve company productivity with a Business Account.Sign Up

ZoppoConnect With a Mentor Author Commented:
Sorry for the long delay, I had some short vacation ...

I did ask MicroSoft support about this and they told the problem most probably is that an internal limit is reached (something about more than 64000 symbols in a SBR file). This (maybe due to a bug) IMO case causes all SBR files of the projects are set to size 0 KB - after this the next build fails with the BK1505.

The provided workaround is to turn the projects option 'Configuration Properties -> Browse Information -> General -> Preserver SBR files' to 'Yes' - I guess this may increase build time a bit (I didn't measure but MSDN tells this option does 'force a full build of the browse information file whether or not a .bsc file exists') but it solved my problems, my project now builds fine.
AndyAinscowFreelance programmer / ConsultantCommented:
Does turning off the antivirus software during the build help ?
ZoppoAuthor Commented:
I'll try to reproduce it with deactivated antivirus software - but it may take a while since the problem isn't easy to reproduce.
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

AndyAinscowFreelance programmer / ConsultantCommented:
Just a thought - I've had problems apparently with the anti virus locking a file that VS wanted at that instant.
There is another question, you AndyAinscow answered - something about the virtual memory. There is a proposal to modify the environment variables such as TEMP, TMP.
I had a problem like this one with VS 2005 (?) and the fix was to set TEMP and TMP on another drive.
The trick may not work now. I think, Microsoft, if you will ask them, will say that something wrong happens because of the multithreaded compilation. I do not use VS 2010 (because of IncrediBuild, it does not work in 2010). I can be wrong. It will take few seconds to check.

ZoppoAuthor Commented:
Thanks for the suggestisons - I'm still testing this, but unfortunateley I still didn't find a way to really reproduce it since as I wrote it only happens from time to time. Up to now I unfortunateley wasn't able to reproduce the mentioned 'BK1505' error, no matter if AV software is running or to which drive TMP/TEMP point to.

But just now I have another symptom which might be related: The build of the large project now ends up with this warning:
>> d:\programme\microsoft visual studio 10.0\vc\include\xtree(398): warning BK4504: file contains too many references; ignoring further references from this source

After this the project links fine, but all SBR files in the output directoy have the size 0 Bytes - I checked and found that before the last file finished compiling all the SBR files have valid sizes.

I go on trying to find a way to reproduce and/or a workaround - if I don't find one I will send a request to MS support, maybe they can anyhow help - I'll let you know ...
Please do post a solution if you find one. I have exactly the same BK1505 problem, and it's preventing me from switching to VS2010.
I have been getting "BK4504: too many references" for years, and it has never caused any trouble, so it doesn't seem related to me.
AndyAinscowFreelance programmer / ConsultantCommented:
Hmmm.  Could be 0xFFFF or similar being overrun.

Well at last it now works.
ZoppoAuthor Commented:
Yes, something like this ...

BTW, do you know if this question goes into PAQ archive if I accept my last comment as solution? I never did that before ...
AndyAinscowFreelance programmer / ConsultantCommented:
As far as I know it will do.
I reported the problem to Microsoft here: They asked for more information but otherwise haven't responded yet.
Zoppo, could you please visit my bug report to Microsoft and click "I can too" next to "0 User(s) can reproduce this bug" to let them know I'm not the only one? Thanks!
I think you can follow this link:
ZoppoAuthor Commented:
@ProtoDev: I did it ...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.