dotnet / try

Try .NET provides developers and content authors with tools to create interactive experiences.
MIT License
2.85k stars 517 forks source link

Underscore in source file name causes BudgetExceededException #869

Open jonsequitur opened 3 years ago

jonsequitur commented 3 years ago

From https://github.com/dotnet/try/issues/859#issuecomment-666637355

This works:

'''cs --region source --source-file ./main.package.cs
'''

This does not:

'''cs --region source --source-file ./main_package.cs
'''

Only difference is an underscore in main project file name??!!

ritchiecarroll commented 3 years ago

Here's a sample repo with an example that works and one that fails, both identical save an underscore in the primary .cs file name:

https://github.com/ritchiecarroll/dotnet-try-test

jonsequitur commented 3 years ago

@ritchiecarroll I couldn't repro the bug:

image

ritchiecarroll commented 3 years ago

I usually use dotnet-try --verbose from the failed folder to produce error. Interesting that this doesn't work for you. What version are you using? Any other system component versions I should check?

ritchiecarroll commented 3 years ago

Well - tried this on another computer, it doesn't replicate there. Whatever confluence of parameters that causes this to fail on my primary system doesn't happen on a secondary system.

Sorry for the false alarm.

I think the best pursuit will be be based on external assemblies, although I still believe there is some kind of timing issue here.

I will try to find a more reproducible version...

ritchiecarroll commented 3 years ago

OK, after some work, here's an example I can get to fail consistently - at least the first time. This fails consistently from both my test machines.

First, re-pull sample repo: https://github.com/ritchiecarroll/dotnet-try-test

FYI, I updated the `failed' test project in this repo to now operate with a simple project dependency.

To get it to fail, first delete the following folders/files:

bin
obj
package_fullBuild.binlog

then run

dotnet-try --verbose

Now, the first time you run the code (clicking 'run' button on browser) it fails with error below. If you click run again, the second time it runs fine. The failure is as follows - same as seen before:

[MLS.Agent.Middleware.ExceptionFilter]  ❌ System.InvalidOperationException: No design time or full build available

Now the interesting part is, I can also, randomly, get this failure with even the works project that has no external dependency. Like with the other project, clicking run again, everything works fine.

Seems like a race condition of somekind.

Hope this helps replicate the issue enough to track down the issue.

ritchiecarroll commented 3 years ago

FYI, if you want 100% replicability, follow these steps:

git clone https://github.com/GridProtectionAlliance/go2cs.git
cd go2cs\src\examples\manual tour of go conversions\basics\zero\
dotnet-try --verbose

FYI, to specifically replicate the BudgetExceededException, clear out bin\obj folders and .binlog file then simply use the verify option on the sample:

dotnet-try --verbose verify

You can try a few of these other examples for more tests:

go2cs\src\examples\manual tour of go conversions\basics\named-results\
go2cs\src\examples\manual tour of go conversions\methods\reader\
go2cs\src\examples\manual tour of go conversions\methods\stringer\
go2cs\src\examples\manual tour of go conversions\flowcontrol\defer-multi\
go2cs\src\examples\manual tour of go conversions\concurrency\buffered-channels\
go2cs\src\examples\manual tour of go conversions\concurrency\range-and-close\