1

I am currently working on a static source code analyzer for ASP.NET projects. My analyzer runs fine on ASP.NET WebForms but there seem to be issues with MVC projects. There are certain identifiers/tokens in MVC Projects that do not seem to have an underlying symbols, hence when my analyzer tries to do analysis with the symbol, an NullReference exception will occur. Are there any known issues of Roslyn working with MVC projects? I read this post How to use Roslyn Code Analysis API with MVC 6 projects , but i cant seem to install the DNX workspace package on my project.

Community
  • 1
  • 1
Kim KangIn
  • 349
  • 1
  • 14
  • 2
    Could you be more specific? What exactly are you doing and which identifiers or tokens are causing the probelms? Could this be some kind of problem with references? – svick Jul 15 '16 at 09:53
  • i think my problem was that my analyzer utilizes Roslyn's symbols API, however in MVC projects, it is common to use `ViewBag` which is a `dynamic` class, and hence there is no underlying symbol for it as the object is `dynamic` and hence will only be resolved during runtime. https://msdn.microsoft.com/en-us/library/system.web.mvc.controllerbase.viewbag(v=vs.118).aspx#P:System.Web.Mvc.ControllerBase.ViewBag – Kim KangIn Jul 18 '16 at 02:24

0 Answers0