Linked Questions
21 questions linked to/from Which version of C# am I using
1
vote
2
answers
7k
views
How can i find out what C# version I'm programming with in Visual Studio Community? [duplicate]
I want to make sure I'm using C# 7.0 or higher. Does anyone know an easy way of checking this? I use Visual Studio Community on a MacBook and cannot seem to find an easy way of checking or setting ...
-1
votes
1
answer
288
views
How to detect C# (not CLR) version programmatically? [duplicate]
I use C# for .NET. I know how to programmatically detect CLR version of a .NET assembly, but can’t find out how to programmatically detect the C# version in my code. Anyone has idea? TIA.
2923
votes
13
answers
441k
views
What are the correct version numbers for C#?
What are the correct version numbers for C#? What came out when? Why can't I find any answers about C# 3.5?
This question is primarily to aid those who are searching for an answer using an incorrect ...
35
votes
4
answers
10k
views
C# 7 ValueTuple compile error
I'm using VS2017 RC and my application targets net framework 4.6.1.
I have two assemblies referencing System.ValueTuple 4.3
MyProject.Services
MyProject.WebApi
In MyProject.Services I have a class ...
16
votes
2
answers
42k
views
How to set default value using data annotation
I am learning ASP.Net MVC 5 and I want to set default value using data annotation for boolean property. Also I don't want to use the constructor to set the default value. Is it possible?
public class ...
22
votes
3
answers
17k
views
Which C# version .NET Core uses?
I know that C# version depends on .NET Framework.
But .NET Core which version uses?
Particularly .NET Core 2? C#7?
11
votes
2
answers
12k
views
How to determine C# compiler version in command line
Is there any command to get the C# compiler version?
The csc command seams has no option to show compiler version.
P.S
when I enter csc command in Developer Command Prompt For VS2015 it returns:
...
8
votes
3
answers
4k
views
How do I tell the Roslyn C# compiler to use a specific version of .NET?
I've discovered that the csc.exe binary that comes with Roslyn can take a -langversion:<string> command line argument in order to set the version of C# I would like to compile. But how do I ...
2
votes
2
answers
3k
views
What version of Objective-C am I using?
How do I tell what version of Objective-C I'm using? I'm using a Mac with xCode. The reason I ask is because i have a book "Objective-C 3.0" and it says that you can declare an ...
5
votes
1
answer
1k
views
Using System.CommandLine with custom Main() signature
I'm trying to use System.CommandLine and I've installed the nuget package:
Install-Package System.CommandLine -Version 2.0.0-beta1.21308.1
According to this Microsoft article, I should be able to ...
2
votes
1
answer
3k
views
Determine C# version in Visual Studio 2019 / .NET Framework 4.8
I have a project running .NET Framework 4.8 and in the project's properties under "Build > Advanced > Language Version" Visual Studio states "Automatically selected based on ...
1
vote
2
answers
2k
views
Binding Complex Data source of a class into Grid View
Here I have these Classes:
public class CustomerDebt
{
public int ID { get; set; }
public string Name { get; set; }
public string Family { get; set; }
public string Remain { get; set; ...
-2
votes
1
answer
2k
views
ERROR [37000] [IBM][CLI Driver] CLI0118E Invalid SQL syntax. SQLSTATE=37000
I have a simple SQL statement query that is executed as command from C# code. It is targetting DB2. I created variables for the server/schemas as follows. It throws error.
private const string ...
0
votes
4
answers
134
views
c# convert existing class to use properties correctly
I have the following classes:
class Given
{
public string text = "";
public List<StartCondition> start_conditions = new List<StartCondition>();
};
class StartCondition
{
...
0
votes
4
answers
452
views
handling no result found
Following line throw exception if there is no matching record found.
Guid stuId= context.Students.FirstOrDefault(x => x.Name == student.Name).Id;
I understand, i can handle above line
var stuId= ...