Questions tagged [microsoft.codeanalysis]

Formerly known as Project roslyn.

see https://www.nuget.org/packages/Microsoft.CodeAnalysis

69 questions
0
votes
1 answer

C# dlr LanguageSetup setup for Script Runtime

Please does anyone know how to set up a C# ScriptEngine using Microsoft.CodeAnalysis.CSharp.Scripting var runtimeSetup = new ScriptRuntimeSetup(); LanguageSetup languageSetup = new LanguageSetup( "CSharp.Runtime.Context, CSharp", "CSharp", …
0
votes
1 answer

C# vS2017 project not building: Could not load file or assembly Microsoft.CodeAnalysis

I have a new laptop with Windows 10. I installed the latest Visual Studio 2017. I opened up the c# solution which I had previously been working on a Windows 7 laptop with an older version of Visual Studio 2017 (i.e. not the latest update). The…
0
votes
1 answer

How to add As Clause (type) to a property created with SyntaxFactory?

I am creating a property with SyntaxFactory (roslyn) Dim [property] = SyntaxFactory .PropertyStatement("MyProperty").AddModifiers(SyntaxFactory .Token(SyntaxKind.FriendKeyword)) The result is Friend Property MyProperty To add the property type I…
IvanH
  • 5,039
  • 14
  • 60
  • 81
0
votes
0 answers

How to get SyntaxNode content if it is a method and implemented outside current SyntaxTree?

I am trying to get "content" (SyntaxNodes) of a method when all I have is a SyntaxNode and SyntaxNodeAnalysisContext received by RegisterSyntaxNodeAction(AnalyzeNode, SyntaxKind.InvocationExpression). Method (SyntaxNode) implementation is in another…
Dmitry
  • 421
  • 4
  • 14
0
votes
1 answer

Visual Studio repeatedly rebuilds projects after code analyser is updated

This relates to Visual Studio 2017 Community. Most of our build process prefers the VS2015 tools, but has been updated to build under VS2017 tools too. Say we have a project MyProject.csproj which references a code analyser binary…
Alex Davidson
  • 337
  • 1
  • 10
0
votes
0 answers

Sonarqube plugin for Microsoft.CodeAnalysis.CSharp

I'm trying to report code analysis from Visual Studio into the SonarQube server. I'm unable to port the rules from Microsoft.CodeAnalysis.CSharp and could not generate a plugin with the Sonar Roslyn Sdk project due to errors. Is there a plugin…
0
votes
1 answer

Why can't I get all ObjectCreationExpressionSyntax if initialized as null?

So, I have a MethodDeclarationSyntax node that I'm passing to a CSharpSyntaxWalker, with the following overrides public override void VisitObjectCreationExpression(ObjectCreationExpressionSyntax node) { LiteralExpressionCollector…
Daniel Mendonça
  • 391
  • 1
  • 3
  • 14
0
votes
0 answers

How to capture the project user is currently working in Visual Studio 2015 solution

I'm developing a VS extension for analyzing build artifacts of the active (project user is editing) project, I need to capture the project name so that I can build the project and proceed to next step. It seems this can be achieved from…
0
votes
2 answers

Analyzer threw InvalidOperationException with message 'Sequence contains no elements' in Visual Studio 2015

I converted a Visual Studio 2010 project to Visual Studio 2015, and the conversion worked fine, so I decided to change the target framework to .NET 4.6.1, just to see if there would be any issues. I then I got the following error: Analyzer …
1 2 3 4
5