lprun7 "Unable to read beyond the end of the stream"
LINQPad Version: 7.4.9 and Beta 7.5.5
On doing either of
- 'lprun7 script.linq'
- Util.Run('script.linq', QueryResultFormat.Text)
Result: Unable to read beyond the end of the stream.
Stacktrace (from Util.Run example)
System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
at System.IO.BinaryReader.Read7BitEncodedInt()
at System.IO.BinaryReader.ReadString()
at LINQPad.ExecutionModel.CachedQueryCompiler.CacheEntry..ctor(QueryCore query, DataContextInfo dcInfo, Boolean checkDCInfo)
at LINQPad.ExecutionModel.CachedQueryCompiler.IsInCache(QueryCore query, ReferenceSet& refSet)
at LINQPad.ObjectModel.QueryCompilation.CheckNuGetRefs(QueryCore query, Boolean nuNuGet)
at LINQPad.SystemExtensions.ThrowWithOriginalStackTrace(Exception ex)
at LINQPad.TaskExtensions.WaitEx(Task t, Nullable`1 timeout)
at LINQPad.Util.Run(String queryFilePath, QueryResultFormat format, Boolean freshenNuGetPackages, Object[] args)
at LINQPad.Util.Run(String queryFilePath, QueryResultFormat format, Boolean freshenNuGetPackages, String[] args)
at LINQPad.Util.Run(String queryFilePath, QueryResultFormat format, String[] args)
at UserQuery.run_scheduled_item(Scheduled_item scheduled_item, Boolean suppress_warning) in %\AppData\Local\Temp\1\LINQPad7_mmxzhtvl\vpzjqp\LINQPadQuery:line 322
I've noticed that renaming the file is the only thing I could find that fixes this.
i.e. script.linq -> script_.linq then no error
Problem seems to be consistent once it happens but not directly related to any particular script.
As in, have seen examples where a script was run many times a day without problem and after a few days get this error until rename the file.
No obvious pattern in terms of the files affected.
Suspecting something like a corrupted temp file or cache.
Hopefully that's actionable and let me know if more info needed or something I could check or try.
LINQPad GUI functionality (excepting Util.Run) seems otherwise good for said files.
Comments
Tried after deleting contents of %LOCALAPPDATA%\Temp but no change.
Also once the filename "goes bad" the contents can be anything, even blank, and still errors.
e.g. Still errors on replacing file contents with default:
void Main()
{
}
// You can define other methods, fields, classes and namespaces here
This should now be fixed in 7.5.7. Let me know if it's still an issue.