Category: C#

How to generate a random number in C# and .NET?

If you want to generate a random number in your .NET application using C#, you can use the random class to generate one. How to generate a random number in C# and .NET? Below is a sample code snippet on how to generate random numbers in C#. Try to keep the instance of the Random class and reuse it Incase you are generating more than…

C# Compiler Error – CS8357 the specified version string contains wi

In this blog post, you’ll learn more about the C# Compiler Error – CS8357 and the related message description C# Compiler Error Code CS8357 C# Compiler Description for the Code :CS8357 The specified version string contains wildcards, which are not compatible with determinism. Either remove wildcards from the version string, or disable determinism for this compilation

C# Compiler Warning – CS4014 because this call is not awaited, execut

In this blog post, you’ll learn more about the C# Compiler Warning – CS4014 and the related message description C# Compiler Warning Code CS4014 C# Compiler Description for the Code :CS4014 Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the ‘await’ operator to the result of the call.

C# Compiler Error – CS8920 the interface ‘{3}’ cannot be used as ty

In this blog post, you’ll learn more about the C# Compiler Error – CS8920 and the related message description C# Compiler Error Code CS8920 C# Compiler Description for the Code :CS8920 The interface ‘{3}’ cannot be used as type parameter ‘{2}’ in the generic type or method ‘{0}’. The constraint interface ‘{1}’ or its base interface has static abstract members.