Skip to content

Conversation

@keithlogan94
Copy link
Contributor

  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for your PR that you are making. Please open an issue to dicuss changes or new features.

PR Title
Added include libraries

PR Description
Added include libraries

Fixes #7

@keithlogan94 keithlogan94 added this to the 0.1.0 milestone Sep 1, 2021
@keithlogan94 keithlogan94 changed the title update bug: include libraries Sep 1, 2021
@keithlogan94 keithlogan94 changed the title bug: include libraries fix: include libraries Sep 1, 2021
@babanfaraj
Copy link
Contributor

LGTM

@andrewbabbittdev
Copy link
Member

Looks like a bug in Rider. Code compiles without these meaning they aren't needed.

I'll double check this when I hop on in about an hour.

@andrewbabbittdev
Copy link
Member

unneeded
Definitely a bug in rider, this should be brought to their attention I'm just not sure what channels/how we go about doing so.

@andrewbabbittdev
Copy link
Member

andrewbabbittdev commented Sep 2, 2021

@keithlogan94

Fully confirmed, this is indeed a rider bug.

C# 10 / .NET 6 added a new global usings feature. You can read up on it here.

As for how this is causing rider to detect this as an error, .NET 6 Preview 7 (the latest preview release) added commonly used namespaces as global using's in web projects. You can see the tracking item at dotnet/aspnetcore#32451 and the implementation in dotnet/sdk#18459.

After a build you can open the file src/Medulla.Frontend/Server/obj/Debug/net60/Medulla.Frontend.Server.ImplicitNamespaceImports.cs which has the following content:

// <autogenerated />
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;
global using global::System.Net.Http.Json;
global using global::Microsoft.AspNetCore.Builder;
global using global::Microsoft.AspNetCore.Hosting;
global using global::Microsoft.AspNetCore.Http;
global using global::Microsoft.AspNetCore.Routing;
global using global::Microsoft.Extensions.Configuration;
global using global::Microsoft.Extensions.DependencyInjection;
global using global::Microsoft.Extensions.Hosting;
global using global::Microsoft.Extensions.Logging;

Rider does not appear to be analyzing this file for whatever reason while Visual Studio and VS Code both do. This should get fixed in a future rider update. Keep in mind Rider does not fully support .NET 6 yet, can check out their post on it here. This is actually a nice new feature in .NET 6, so would really like to embrace it.

Visual Studio 2022 & VS Code are fully supported and updated every month to support the latest preview sdk updates. This should be less of an issue as we get closer to the GA release of .NET 6 in November. RC1 will be out on the 14th.

Until a fix is added to rider we could either just have you guys ignore the bug in rider or we could add <DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports> into all csproj files and add all the usings manually.

Ideas/thoughts?

@andrewbabbittdev andrewbabbittdev removed this from the 0.1.0 milestone Jan 24, 2022
@andrewbabbittdev
Copy link
Member

Resolved with latest rider versions.

@andrewbabbittdev andrewbabbittdev deleted the kbecker/fix-bug branch January 30, 2022 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add include for libraries

4 participants