Skip to content
This repository has been archived by the owner on Sep 21, 2018. It is now read-only.

Remove unused Microsoft.IdentityModel.Protocols.OpenIdConnect using statement from Work and School templates #563

Closed
dougbu opened this issue May 12, 2016 · 4 comments

Comments

@dougbu
Copy link
Member

dougbu commented May 12, 2016

Bad enough that most of the C# files in this template have unnecessary usings but why does the Startup class use Microsoft.IdentityModel.Protocols.OpenIdConnect? The UseOpenIdConnectAuthentication() extension isn't in that namespace and that looks like all that's used here.

Of course, close this as a dupe if a general Remove and Sort Usings is already planned.

@phenning
Copy link
Contributor

We should remove the Microsoft.IdentityModel.Protocols.OpenIdConnect using statement.

Do you see any other "unused" namespaces other then the following? We include these in all template files as a matter of course in all CS files.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

@dougbu
Copy link
Member Author

dougbu commented May 12, 2016

We include these in all template files as a matter of course in all CS files.

Why is this "a matter of course"? Unused means unnecessary here.

The first thing VS does if you open one of these files is offer to remove unused usings. Right-thinking editors like VS Code go further and include unused usings in the warnings it displays. And IntelliSense will add anything that's needed right back -- if that ever happens.

usings

@phenning
Copy link
Contributor

My understanding is that the reason we want those particular namespaces in there for discoverability and as a convenience for those common namespaces which customers would most likely use when expanding the template content. We actually have an explicit build step to enforce that these namespaces are present and in order.

In any event, removing anything other then the OpenIdConnect namespace would likely not be something we would take for preview1

//cc @Eilon, @DamianEdwards @rustd

@phenning phenning changed the title Why does Work and School's Startup use Microsoft.IdentityModel.Protocols.OpenIdConnect? Remove unused Microsoft.IdentityModel.Protocols.OpenIdConnect using statement from Work and School templates May 12, 2016
@phenning
Copy link
Contributor

TFS 220979

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants