Reading method instructions using Roslyn
Hi, I am trying to replace Mono.Reflection with Roslyn in my project. I am getting issue for one class, member of Mono.Reflection i.e. MethodBodyReader which takes method as input and returns list...
View ArticleRoslyn compiler, set Win32ICON
How do I give my roslyn compiler output an icon?In codedom I can simply use the CompilerOptions and add it as "/win32icon:<path here>"But how to do in roslyn? I've this already. var syntaxTree =...
View ArticleReplaceNode - new tree does not contain the replaced node instance
Hello,given the following example: var isTrue = compilationUnit.DescendantNodes().Any(x => x == node); var newCompiliationUnit = compilationUnit.ReplaceNode(node, newNode); var...
View ArticleSample Console Program for removing Unused using NameSpace
Hello Everyone,I am very much new to Roslyn. We are going to use Roslyn 2015 SDK in our Project for our Custom Code format and refactoring purpose. I have installed Microsoft.CodeAnalysis 1.3.2 from...
View ArticleGetting exception "NotSupportedException: Changing parse options is not...
Hi,I am trying to update csproj file with a Feature IOperation added so that new IOperation features can be used from project.I tried adding parsing options and updating the workspace. But it thew an...
View ArticleCreate Resource from within a Fix Provider
Hi, Can somebody hint me how to write a Roslyn provider that can create resource in the C# project where the fix provider is operating.What I want is to be able to click on a literal string in the...
View ArticleHow to detect missing Assembly references when a project is loaded
When I load a project in Roslyn that has an assembly reference like this: <ItemGroup> <Reference Include="SomeLibrary" /> </ItemGroup>I've noticed that if the Assembly does not...
View ArticleVisual Studio 2015 Update 3 freezes when running FxCop + Roslyn rules
For our project we're currently running some FxCop (Managed Binary Analyses) and Roslyn (SonarLint) rules as part of our local build. In total 148 FxCop rules and about 78 SonarLint rules are...
View ArticleIs it possible to use Roslyn to obfuscate source code?
I want to make a copy of my project and obfuscate the source code with Roslyn And then compile, Project regular way with Visual Studio. Is it possible? I'm not familiar with Rosaleen if you could...
View ArticleVS 2013 Update 5 install stuck in "Applying Workflow Manager Tools 1.0"
Installing VS 2013 Update 5The install has been on displaying Applying Workflow Manager Tools 1.0 for a long time (1+ hours. This is on a Windows 10 machineAny ideas?
View ArticleRoslyn Unit Testing: how to add a reference to assembly 'System.Runtime' to...
Hi All,I am working with one roslyn unit tests for an analyzer in which I am enforcing an attribute usage for Analyzer implementations. A kind of auxiliary analyzer which checks some attributes in...
View ArticleCode analysis not always reporting all issues
We have a rather large solution (~60 projects) and we are fully using code analysis for it. I have done that on similar solutions before and never had problems with it.But this time (using VS2015...
View ArticleAdd Content to the compiler
I am generating a wcf webservice via unity with the help of Roslyn. But part of that is adding a 'dummy' .svc file to the project.In VS this is accomplished by adding a .svc file with Build Action...
View ArticleSpecific method is not supported exception on...
I tried to add a custom dll reference to every project of a solution by the following code, it will throw exception even if I comment out MyFun call, which does some code modification and save back to...
View ArticleRoslyn: aspnet_compiler doesn't wait for VBCSCompiler to finish
Hi, I am using roslyn compiler for my website and I'm facing issue where after compilation is done via aspnet_compiler, there's still hanging VBCSCompiler.exe for couple of seconds. I know that it's...
View ArticleAfter migrating FxCop rules to Roslyn, code analysis warnings are treated as...
Hi, I am working with converting some of our custom FxCop rules to Roslyn analyzers. Most of our product code C# projects are configured to treat (compiler) warnings as errors, as we want to avoid...
View ArticleControl Flow Graph, Inter/Intra data flow analysis with Roslyn
Is it possible to generate a call graph, do inter/intra procedural analysis with Roslyn?I am trying to do taint analysis, i.e. I should be able to trace a variable after it has been passed through...
View ArticleCustom FxCop rules created in VS 2013 not getting loaded in VS2015
Hi, I am checking the feasibility of migrating our projects from VS2013 to Roslyn based VS2015. We have plan to migrate many of the existing FxCop rules to Roslyn but as a first step we need existing...
View ArticleHow to retrieve SyntaxNodes between #region and #endregion directives?
Hi,is there an easy wat to retrieve all SyntaxNodes that are located between a #region and the corresponding #endregion directive?Currently this seems to be a really messy task. I know that #region and...
View ArticleCompilation errors when compiling project
I am trying to write a code that will test if any method has ExecuteReader without corresponding Close reader - basic test to play with, just checks if ExecuteReader and Close are in the same...
View Article