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

Issue with the connectionstring when executing with VSCode #1

Open
santoshpatro opened this issue Jun 22, 2018 · 1 comment
Open

Issue with the connectionstring when executing with VSCode #1

santoshpatro opened this issue Jun 22, 2018 · 1 comment

Comments

@santoshpatro
Copy link

santoshpatro commented Jun 22, 2018

I tried the below using VSCode and got the error related to connectionstring.

I have updated the connectionstring to "NHLStatsDb": "Data Source=.;Initial Catalog=NHLStats;Trusted_Connection=True;MultipleActiveResultSets=true"
On running the command by navigating to the dotnet run command from the root of the \NHLStats.Api folder

I am getting the following error:
Application startup exception: System.ArgumentNullException: Value cannot be null.
Parameter name: connectionString
at Microsoft.EntityFrameworkCore.Utilities.Check.NotEmpty(String value, String parameterName)
at Microsoft.EntityFrameworkCore.SqlServerDbContextOptionsExtensions.UseSqlServer(DbContextOptionsBuilder optionsBuilder, String connectionString, Action`1 sqlServerOptionsAction)

I opened the project using VS2017 and found all this works fine.

Any help on this is much appreciated

@santoshpatro santoshpatro changed the title Issue with the connectionstring Issue with the connectionstring when executing with VSCode Jun 22, 2018
@jaylandro
Copy link

jaylandro commented Apr 22, 2019

In order to run this anywhere other than Visual Studio, you will need to set an Environmental variable to trigger Developer appsettings.

If you are using Powershell and starting from the command line you can use:
$env:ASPNETCORE_ENVIRONMENT="Development"; dotnet run

For other shells, see the docs here: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/environments?view=aspnetcore-2.2#windows

Also for anyone running, the URL for GraphiQL Explorer is http://localhost:5000/graphql/ after startup.

Good Luck!

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

No branches or pull requests

2 participants