I am new to Blazor Development. Does any know how to solve this issue? I only have this issue if I login as a user. When I try to step into the code. It stop after the ApplicationDbContext class and throw this error after the options.UseSqlServer(connectionString)). Your help is greatly appreciate it. Below is the error I got. Let me know if you guys need anything else.
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ?? throw new InvalidOperationException("Connection string 'DefaultConnection' not found.");
builder.Services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(connectionString));
builder.Services.AddDatabaseDeveloperPageExceptionFilter();
Error :
One or more errors occurred. (Value cannot be null. (Parameter
‘value’))
at Jn (c:UsersmyuserDocumentsVisual Studio 2022ProjectsHmongCenterGBHmongCenterGBHmongCenterGBwwwroot_frameworkhttps:raw.githubusercontent.comdotnetruntime5535e31a712343a63f5d7d796cd874e563e5ac14srcmonowasmruntimemarshal-to-js.ts:349:18)
at Ul (c:UsersmyuserDocumentsVisual Studio 2022ProjectsHmongCenterGBHmongCenterGBHmongCenterGBwwwroot_frameworkhttps:raw.githubusercontent.comdotnetruntime5535e31a712343a63f5d7d796cd874e563e5ac14srcmonowasmruntimemarshal-to-js.ts:306:28)
at wasm://wasm/00b1e8b6:wasm-function[350]:0x1faca
at wasm://wasm/00b1e8b6:wasm-function[246]:0x1bf8b
at wasm://wasm/00b1e8b6:wasm-function[239]:0xf172
at wasm://wasm/00b1e8b6:wasm-function[307]:0x1e7e4
at wasm://wasm/00b1e8b6:wasm-function[328]:0x1efda
at wasm://wasm/00b1e8b6:wasm-function[218]:0xcfec
at wasm://wasm/00b1e8b6:wasm-function[774]:0x440ad
at e. (https://localhost:7030/_framework/dotnet.runtime.8.0.0.nk3t6c0vmt.js:3:214976)
{superStack: {…}, stack: , message: ‘One or more errors
occurred. (Value cannot be null. (Parameter ‘value’))’, Symbol(wasm
js_owned_gc_handle): 86}
I step into the code, but it does not give me any information to give this issue resolve. What I expect to happen was. When the user login it will go straight to the home page. It was able to navigate to the home page, but the code within the home page was never trigger at all. It just throw this error.
Tou Thao is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2