Comments (4)
These should all be available now.
from try.
This issue should be reopened.
Although the user's current culture is detected for code run directly in the try.dot.net REPL, this is not the case for code run from docs.microsoft.com/dotnet.
For instance, the example for the "C" standard numeric format string in Standard numeric format strings is:
double value = 12345.6789;
Console.WriteLine(value.ToString("C", CultureInfo.CurrentCulture));
Console.WriteLine(value.ToString("C3", CultureInfo.CurrentCulture));
Console.WriteLine(value.ToString("C3",
CultureInfo.CreateSpecificCulture("da-DK")));
This produces the following output:
(2,39): error CS0103: The name 'CultureInfo' does not exist in the current context
(3,40): error CS0103: The name 'CultureInfo' does not exist in the current context
(5,19): error CS0103: The name 'CultureInfo' does not exist in the current context
If the code is modified by fully qualifying references to CultureInfo, it works:
¤12,345.68
¤12,345.679
kr. 12.345,679
If it is wrapped in a complete type/method, an OutOfMemoryException results. For example, the following code:
public class Example
{
public static void Main()
{
double value = 12345.6789;
Console.WriteLine(value.ToString("C", System.Globalization.CultureInfo.CurrentCulture));
Console.WriteLine(value.ToString("C3", System.Globalization.CultureInfo.CurrentCulture));
Console.WriteLine(value.ToString("C3",
System.Globalization.CultureInfo.CreateSpecificCulture("da-DK")));
}
}
produces the following output:
System.OutOfMemoryException: Out of memory
at (wrapper managed-to-native) System.AppDomain.LoadAssemblyRaw(System.AppDomain,byte[],byte[],System.Security.Policy.Evidence,bool)
at System.AppDomain.Load (System.Byte[] rawAssembly, System.Byte[] rawSymbolStore, System.Security.Policy.Evidence securityEvidence, System.Boolean refonly) <0x29da3b8 + 0x0003e> in <900ecd0f11284a0ca19b03bb59a43de7>:0
at System.AppDomain.Load (System.Byte[] rawAssembly, System.Byte[] rawSymbolStore, System.Security.Policy.Evidence securityEvidence) <0x29da258 + 0x00022> in <900ecd0f11284a0ca19b03bb59a43de7>:0
at System.AppDomain.Load (System.Byte[] rawAssembly) <0x29da188 + 0x00014> in <900ecd0f11284a0ca19b03bb59a43de7>:0
at System.Reflection.Assembly.Load (System.Byte[] rawAssembly) <0x29da0c0 + 0x00010> in <900ecd0f11284a0ca19b03bb59a43de7>:0
at MLS.WasmCodeRunner.CodeRunner.ProcessCompileResult (MLS.WasmCodeRunner.CompileResult compileResult, System.Int32 sequence) <0x29d85f8 + 0x00040> in <14b79e8017af40b2b2f7b42a1677165b>:0
And adding a using
statement to the previous code to import the System.Globalization namespace doesn't work:
(1,7): error CS1003: Syntax error, '(' expected
(1,7): error CS0118: 'System.Globalization' is a namespace but is used like a variable
(1,27): error CS1026: ) expected
(1,27): error CS0642: Possible mistaken empty statement
(1,1): error CS1513: } expected
from try.
The difference in behavior between try.dot.net and docs.microsoft.com/dotnet is because the latter is using the in-browser execution model via Blazor, whereas the former is using C# scripting. We can opt specific pages (but not specific samples within a page) out of the Blazor implementation. This is a short-term fix because the scripting-based implementation will be going away. We should discuss how to adjust the content accordingly.
from try.
This issue is no longer relevant to the current implementation.
from try.
Related Issues (20)
- performance degradation HOT 1
- Compile errors not displayed in output area HOT 1
- diagnostics are not cleared when editor is empty
- Compile errors are duplicated in output HOT 4
- Improve Playwright screenshots.
- exception output is not displayed HOT 2
- Completions are incorrect for partial words
- Add a load test
- Sizing issues of the IFrame containing the interactive editor HOT 9
- Console Output shows many "Errors on load" HOT 4
- End of Life HOT 1
- Luminosity contrast ratio of keyboard focus indicator on suggestion dropdown fails to meet the required ratio of 3:1: A11y_.NET Online REPL_NET Editor _Code Suggestion_Non Text Contrast. HOT 4
- Feedback link is visually appearing as button: A11y_.NET Online REPL_NET Editor_Feedback_Usability. HOT 3
- Create a new theme named dotnetwebsite for marketing page HOT 1
- June rough plan of work (2024)
- Site: https://try.dot.net/ Unable to access HOT 2
- Warnings are being treated as errors and preventing program output from being shown HOT 1
- https://try.dot.net under maintenance HOT 3
- Code issue in lesson - no output HOT 3
- Cannot run dotnet try on Mac M2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from try.