tagged [roslyn]

What is new .Net Native

What is new .Net Native Today I have read an article about the new .Net Native on [MSDN](http://blogs.msdn.com/b/dotnet/archive/2014/04/02/announcing-net-native-preview.aspx). > "Windows Store apps st...

Getting debugger context in C# interactive

Getting debugger context in C# interactive C# Interactive seems a lot more powerful than the Immediate Window (at least it handles lambda expressions that are often used in LINQ - see [Visual Studio d...

23 May at 12:2

run single *.cs script from command line

run single *.cs script from command line Is there at last a easy way to execute c# script file from command line? I saw that [discussion on github](https://github.com/dotnet/cli/issues/59) and accordi...

30 May at 13:6

Dynamically compile multiple files into assembly using Rosyln

Dynamically compile multiple files into assembly using Rosyln I've recently seen using CSharpCodeProvider is deprecated in .NET Core 5. I was wondering if there was a smart way to combine into one dll...

Finding everywhere an enum is converted to string

Finding everywhere an enum is converted to string I'm currently trying to find everywhere in a solution where a specific enum is converted to a string, whether or not ToString() is explicitly called. ...

9 Apr at 00:13

Null-conditional operator and string interpolation in C# 6

Null-conditional operator and string interpolation in C# 6 Do the [null-conditional operator](https://msdn.microsoft.com/en-us/library/dn986595.aspx) and [interpolated strings](https://msdn.microsoft....

30 Jun at 23:23

Why can't I throw exceptions from an expression-bodied member?

Why can't I throw exceptions from an expression-bodied member? Using expression-bodied members allows you to define the body of a method or property as a single expression without a return keyword (sh...

23 Aug at 21:5

How to compile a C# file with Roslyn programmatically?

How to compile a C# file with Roslyn programmatically? I read that you can't compile C# 6.0 with CSharpCodeProvider and therefor trying to do with with Roslyn. But I can't find a good example how to l...

24 Sep at 20:29

Is Roslyn cross platform?

Is Roslyn cross platform? I've been looking at [Roslyn](https://en.wikipedia.org/wiki/.NET_Compiler_Platform) for quite some time now, and I'm curious and excited about it. One thing I noticed is that...

26 Nov at 13:29

Specifying locale for string interpolation in C#6 (Roslyn CTP6)

Specifying locale for string interpolation in C#6 (Roslyn CTP6) String interpolation in C#6 lets me write: However, a very common use case for string formatting is to specify the locale used for forma...

.NET Core - System.Private.CoreLib.dll vs System.Runtime

.NET Core - System.Private.CoreLib.dll vs System.Runtime In a .NET Core App, if I do `typeof(DateTime).Assembly.Location` I get > C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Pri...

Is Roslyn the right tool for a compile-time Expression checking?

Is Roslyn the right tool for a compile-time Expression checking? I have a toolkit that has many methods often taking `Expression>` as parameters. Some can be single-level only (`o=>o.Name`), while som...

19 Mar at 10:5

Are Roslyn SyntaxNodes reused?

Are Roslyn SyntaxNodes reused? I've been taking a look to [Roslyn CTP](http://msdn.microsoft.com/en-us/roslyn) and, while it solves a similar problem to the [Expression tree API](http://msdn.microsoft...

2 May at 16:17

Use Roslyn code analyzer in same solution

Use Roslyn code analyzer in same solution I have a solution comprised of several .NET Core projects. I have a few code analysis tasks I'd like to perform that are only applicable to this solution, so ...

19 Mar at 15:11

Could not find a part of the path ... bin\roslyn\csc.exe

Could not find a part of the path ... bin\roslyn\csc.exe I am trying to run an ASP.NET MVC (model-view-controller) project retrieved from TFS (Team Foundation Server) source control. I have added all ...

1 Jul at 14:15

Null propagation operator and extension methods

Null propagation operator and extension methods I've been looking at Visual Studio 14 CTP along with C# 6.0 and playing with the null-propagation operator. However, I couldn't find why the following c...

10 Jun at 18:34

Building one web project breaks the compiled version of the second in solution

Building one web project breaks the compiled version of the second in solution I have a big solution with 30 projects of which 2 are web projects (MVC and WebAPI) with a bunch of background class libr...

22 Jan at 08:24

Enums in lambda expressions are compiled differently; consequence of overload resolution improvements?

Enums in lambda expressions are compiled differently; consequence of overload resolution improvements? While trying out the Visual Studio 2015 RC, I received a run-time error on previously working cod...

15 Jun at 13:18

How to add parameters to generated method in Roslyn ( Microsoft.CodeAnalysis )? - Need exact syntax

How to add parameters to generated method in Roslyn ( Microsoft.CodeAnalysis )? - Need exact syntax Below is the function I'm using to generate a simple method - ``` //NOTE : SF = SyntaxFactory Li...

visual studio 2015 update 2 RTM and RC debugging context not available

visual studio 2015 update 2 RTM and RC debugging context not available After Updating visual studio to version 2015 update 2 RTM the problem still exist. : Thanks to Patrick Nelson. a patch has been r...

Using System.Dynamic in Roslyn

Using System.Dynamic in Roslyn I modified the example that comes with the new version of Roslyn that was released yesterday to use dynamic and ExpandoObject but I am getting a compiler error which I a...

4 Apr at 13:53

How is Roslyn related to MsBuild?

How is Roslyn related to MsBuild? I'm wondering: How exactly is Roslyn related to MsBuild? My understanding was that 1. Roslyn is a compilation engine 2. MsBuild is is mostly a set of specifications o...

18 Jul at 13:17

What would you do with Compiler as a Service

What would you do with Compiler as a Service Seeing that we'll probably get this feature in the next release what are some of the things you either think you'll be able to do or things you would like ...

'Could not find file ... bin\roslyn\csc.exe'

'Could not find file ... bin\roslyn\csc.exe' In Visual Studio 2017, when hitting + to run my ASP.NET Framework Web API server, I get: [](https://i.imgur.com/sohAXxi.png) Running `Update-Package Micros...

29 Jun at 17:12

Is the Roslyn model so C#/VB.NET centric that it precludes XAML analysis now and in the future?

Is the Roslyn model so C#/VB.NET centric that it precludes XAML analysis now and in the future? I have just read [the blog entry by JetBrains (Resharper) that suggests that Roslyn could never do XAML ...

11 Apr at 10:1