Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pre-Compile During Build returns Error ASPNETCOMPILER(0,0): Error ASPRUNTIME: startIndex cannot be larger than length of string

This question is similar, but I think not the same

msbuild ASPNETCOMPILER ASPNETRUNTIME startIndex error

I have a Web Application which I am trying to publish using Visual Web Developer 2010 Express.

If I publish, locally, or to production server, it makes no difference and UNCHECK Precompile during publishing everything will work fine, it'll publish and work, with no run time errors.

However, if I CHECK the above, then I get an error:

Error   1   startIndex cannot be larger than length of string.  ASPNETCOMPILER  0   0   bms

No other errors, and no other information!

Can anyone help me even begin to trace this?

like image 241
Jamie Hartnoll Avatar asked May 05 '13 10:05

Jamie Hartnoll


2 Answers

For me, Clean and rebuild, deleting .obj folder etc. did not help resolve the error.

My solution was as follows

In VS2013, I right clicked the project in solution explorer and selected 'publish', then selected 'settings' in the publish dialog. Then I expanded 'file publish options'. Then I clicked the configure link next to 'precompile during publishing'. Then I unselected 'Allow precompiled site to be updatable'. Then publishing worked for me. If I undid that selection I could still publish afterward. Hope this helps.

like image 183
KnarfaLingus Avatar answered Oct 19 '22 16:10

KnarfaLingus


Although this question was asked long time ago, I've recently come across this error.

In my case the problem was that I had compressed the drive where the project was stored using the windows feature to save space.

After uncompressing the folder where the web project was stored, the error disappeared.

Hope this help.

like image 43
galmos Avatar answered Oct 19 '22 18:10

galmos