Problem with ASP.Net Core Debug Configuration
I'm developing my first ASP.Net Core Webassembly. I'm fairly familiar C# Windows Desktop applications development but the web side is new to me.
I have a solution with the x.Client, x.Server and x.Shared projects as you'd expect. My run profile is set to "x.Server https".
I've made a basic test-case app with a "PersonController"
[Route("[controller]")]
public class PersonController : Controller
{
public PersonController(Cn2DbContext context)
{
_context = context;
}
private Cn2DbContext _context { get; init; }
// GET
[HttpGet, Route("")]
public IActionResult Index()
{
return Ok(_context.People.Select(p => p.ApiId).ToList());
}
[HttpGet, Route("count")]
public IActionResult Count()
{
return Ok(_context.People.Count());
}
}
If I run my project from VS2022, everything works as expected. navigating to "https://localhost:[port]/person" returns my list of ID's and I can correctly get "Count" to return as well.
Running from Rider, my initial problem was "Windows cannot find 'chrome'. Make sure you've typed the name correctly...". That's odd as the "Open Browser" section of the Run/Debug configurations stated "Default" and I do not use Chrome. I changed this to Edge and the app now launches correctly - the WebAssembly downloads and I see my index page. However, when I manually append "/person" to the URL, the entire WebAssembly seems to reload and I just see the text "Sorry, there's nothing at this address." displayed in my browser.
What would be the difference between my Rider and VS2022 configurations that could cause this? I'd love to revert to Rider as an editor, but can't if I'm unable to cleanly debug my WebAssembly.
TIA,
Adam
Please sign in to leave a comment.
Hello Adam,
Unfortunately, it is a known issue currently open in our tracker. Please upvote the issue and click Watch to subscribe to future status updates.
I'd advise rebuilding the solution and launching it again from Rider - can you access the URL in question? If not, please provide a sample solution that we could use to reproduce the issue and a screencast of the behavior on your side.