Questions tagged [.net-fiddle]

.NET fiddle is an online tool which allows .NET developers to test simple code or try out samples from other developers.

.NET fiddle is an online tool inspired by JSFiddle. It enables .NET developers to test simple code or try out samples from other developers, without having to start up Visual Studio.

15 questions
2
votes
2 answers

Why is internal .NET method so much faster than simpler code copied from .NET open source?

I have following code based on this question. Fiddle here. https://dotnetfiddle.net/vchYHj using System; using System.Diagnostics; public class Program { public static void Main() { ReadOnlySpan r = stackalloc byte[] { 52, 48,…
Vojtěch Dohnal
  • 7,867
  • 3
  • 43
  • 105
1
vote
1 answer

Get all networks of connected nodes (Logic puzzle)

I know this is a question which is more about logic than an actual programming issue, but I hope that someone may guide me into the correct direction to solve this. Look at it like the advent programming riddles :) I have nodes, that are connected…
Xavjer
  • 8,838
  • 2
  • 22
  • 42
1
vote
1 answer

using .Net fiddle on a chromebook, tried to make a guessing game. the hints (higher or lower) arent working and the target number seems to change

I am trying to run the code below on .Net fiddle, and am encountering the following problem. The randomly generated target number seems to change and the hints (higher or lower) seem to change with your guesses. Why is this happening? I'm also sure…
osyt
  • 23
  • 2
1
vote
2 answers

C# console application ReadLine() works in .NET 4.7.2 and not in .NET 5 (on dotnetfiddle)

As I had never written a console application, I thought it was a good idea to start now. If only because of the fact that I find Visual Studio rather sluggish and the idea to be able to test code quickly on one of the playgrounds such as…
1
vote
1 answer

Problem with DotNetFiddle and Console.ReadLine that causes a Re-run when pressing ENTER key

I have a weird scenario using a C# online compiler with this code: int randomNumber; int guess; int countGuess; bool correctGuess = false; bool alreadyCalled = false; int lastGuess; public void Main() { if(!alreadyCalled) { …
Ginxxx
  • 1,602
  • 2
  • 25
  • 54
1
vote
1 answer

dotnetfiddle.net produces newline as \n instead of \r\n in some cases

While testing some snippets in dotnetfiddle.net I noticed strange phenomenom. If verbatim string literal (string starts @") contains newline in it, compiler emits newline as \n in output string instead of \r\n. (for example Environment.NewLine…
Risto M
  • 2,919
  • 1
  • 14
  • 27
0
votes
0 answers

Making bruteforcer to just print combinations

I am making simple bruteforce script in Dotnetfiddle written in C# for printing all combinations in array. The thing is I have no idea how to make it but I want it to be as simple as possible, and after searching for this examples I just got more…
0
votes
1 answer

.NET fiddle not letting me write in console

NOTE: I have figured out that this only affects .NET fiddle if you are using .NET 6. If you aren't using .NET 6 it works fine. Whenever I use the Console.WriteLine() function on .NET fiddle, it doesn't let me interact with the console. I'm new at…
0
votes
1 answer

Why does my random number generated keep changing in .NET Fiddle / dotnetfiddle?

Here's my code: using System; using System.Collections.Generic; public class Program { public static void Main() { Random r = new Random(); int Winner = r.Next(1, 10); bool win = false; …
Luke
  • 19
  • 1
0
votes
0 answers

Using PluralizationService class in dotnetfiddle

I want to do some tests with the class PluralizationService using dotnetfiddle.net but I get an error: The type of namespace name 'Design' does not exist in the namespace 'System.Data.Entity' using System; using…
Pedro Perez
  • 842
  • 6
  • 23
0
votes
1 answer

DotNetFiddle throws "System.Security.SecurityException"

As there's no PSFiddle available at present, I wondered if I could use DotNetFiddle for this purpose by wrapping the PS code in C#. I used the below code: using System; using System.Collections.ObjectModel; using System.Management.Automation; …
JohnLBevan
  • 22,735
  • 13
  • 96
  • 178
0
votes
1 answer

.NET fiddle error when invoking Castle Windsor

I am attempt to use dotnetfiddle to demonstrate a simply Castle Windsor edge case. When it tries to run this code: var container = new WindsorContainer() .Register(Component.For() …
Andrew Shepherd
  • 44,254
  • 30
  • 139
  • 205
0
votes
2 answers

.NET fiddle/Visual Studio: Different results for regex replace on invalid XML character

I'm trying to filter invalid characters from an XML file, and have the following test project; class Program { private static Regex _invalidXMLChars = new…
Avilan
  • 608
  • 2
  • 6
  • 23
-1
votes
1 answer

I'm having trouble using void functions in .NET fiddle

I'm currently taking an It1050 class, and I'm new to coding. I'm having an issue with using void functions with their program. I wanted to know if anyone could help me solve the problem. There's something wrong with the website, and no matter what…
-3
votes
1 answer

Net Fiddle problema with route

i'm problem with Net Fiddle use MVC. When i click the button "Ordernar por Nome" result in Erro page, but in my PC works well. https://dotnetfiddle.net/HCLpdv The problem code is: [HttpGet] public ActionResult Index() { listPessoas = new…
lesimoes
  • 888
  • 2
  • 9
  • 26