Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-469164: Rider doesn't recognize Startup.cs and Controller's methods as used in a minimal ASP.NET Core application

$
0
0
Reporter Nikita Tsukanov (kekekeks) Nikita Tsukanov (kekekeks)
Created Apr 8, 2018 4:16:11 PM
Updated Apr 10, 2018 8:43:02 PM
Subsystem Code Analysis - C#
Assignee Ivan Serduk (IvanSerduk)
Priority Normal
State Submitted
Type Bug
Fix version 2018.2
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions

App is perfectly operational, but Rider shows "Method is never used" warnings, see attached image.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.0.2" />
  </ItemGroup>
</Project>
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;

namespace AspCoreTestApp
{
    class Program
    {
        static void Main(string[] args)
        { 
            new WebHostBuilder()
                .UseKestrel()
                .UseStartup<Startup>()
                .Build().Run();
        }
    }

    public class Startup
    {
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvcCore();
        }

        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {            
            app.UseMvc();
        }
    }
    
    [Route("")]
    public class MyController : ControllerBase
    {
        [HttpGet("")]
        public object Test()
        {
            return new ContentResult
            {
                Content = "Hello world",
                ContentType = "text/plain"

            };
        }
    }
}

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>