Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET CLI Template missing namespace #1329

Closed
ibebbs opened this issue Jan 6, 2020 · 3 comments · Fixed by #1331
Closed

.NET CLI Template missing namespace #1329

ibebbs opened this issue Jan 6, 2020 · 3 comments · Fixed by #1331
Assignees
Labels
🐛 bug Something isn't working
Milestone

Comments

@ibebbs
Copy link

ibebbs commented Jan 6, 2020

** Description **
A new project created using the HotChocolate.Templates.Server does not build

To Reproduce

mkdir HotChocolateTemplateIssue
cd .\HotChocolateTemplateIssue\
dotnet new graphql -n HotChocolateTemplateIssue
cd .\HotChocolateTemplateIssue\
dotnet build

Produces

Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 477.31 ms for D:\Source\Scratch\HotChocolateTemplateIssue\HotChocolateTemplateIssue\HotChocolateTemplateIssue.csproj.
Startup.cs(22,22): error CS1061: 'IServiceCollection' does not contain a definition for 'AddDataLoaderRegistry' and no accessible extension method 'AddDataLoaderRegistry' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) [D:\Source\Scratch\HotChocolateTemplateIssue\HotChocolateTemplateIssue\HotChocolateTemplateIssue.csproj]
Startup.cs(25,33): error CS0103: The name 'SchemaBuilder' does not exist in the current context [D:\Source\Scratch\HotChocolateTemplateIssue\HotChocolateTemplateIssue\HotChocolateTemplateIssue.csproj]
Startup.cs(25,22): error CS1061: 'IServiceCollection' does not contain a definition for 'AddGraphQL' and no accessible extension method 'AddGraphQL' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) [D:\Source\Scratch\HotChocolateTemplateIssue\HotChocolateTemplateIssue\HotChocolateTemplateIssue.csproj]

Build FAILED.

Startup.cs(22,22): error CS1061: 'IServiceCollection' does not contain a definition for 'AddDataLoaderRegistry' and no accessible extension method 'AddDataLoaderRegistry' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) [D:\Source\Scratch\HotChocolateTemplateIssue\HotChocolateTemplateIssue\HotChocolateTemplateIssue.csproj]
Startup.cs(25,33): error CS0103: The name 'SchemaBuilder' does not exist in the current context [D:\Source\Scratch\HotChocolateTemplateIssue\HotChocolateTemplateIssue\HotChocolateTemplateIssue.csproj]
Startup.cs(25,22): error CS1061: 'IServiceCollection' does not contain a definition for 'AddGraphQL' and no accessible extension method 'AddGraphQL' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) [D:\Source\Scratch\HotChocolateTemplateIssue\HotChocolateTemplateIssue\HotChocolateTemplateIssue.csproj]
    0 Warning(s)
    3 Error(s)

Expected behavior
The build should be successful

Desktop (please complete the following information):

  • OS: Windows
  • Version 10 Pro

Additional context
The Startup.cs file is missing a using for HotChocolate. Inserting the following line at line 4 resolves the issue:

using HotChocolate;
@michaelstaib michaelstaib added the 🐛 bug Something isn't working label Jan 6, 2020
@michaelstaib michaelstaib added this to the 11.0.0 milestone Jan 6, 2020
@michaelstaib michaelstaib self-assigned this Jan 6, 2020
@RohrerF
Copy link
Contributor

RohrerF commented Jan 6, 2020

Verifyed this issue. PR opened 🏃

@michaelstaib michaelstaib assigned RohrerF and unassigned michaelstaib Jan 6, 2020
@michaelstaib
Copy link
Member

We have fixed this issue for V11

@michaelstaib
Copy link
Member

I will close this bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants