aspnetcore: Edit and Continue failed in ASP.NET Core web project
Describe the bug
Error CS8055: “Cannot emit debug information for a source text without encoding.” is reported when editing ASP.NET Core web project while debugging.
Reported as VS feedback: https://developercommunity.visualstudio.com/content/problem/414645/edit-and-continue-not-working-with-aspnet.html. Internal bug 736856.
To Reproduce
- Create a C# ASP.NET Core Web Application (MVC). ASP.NET Core 3.0.
- Set a break point in
Indexmethod inHomeController.cs.
public IActionResult Index()
{
// int i = 1;
return View();
}
- F5 (The platform is AnyCPU).
- Uncomment
// int i = 1; - F10
Expected
ENC is successful.
Actual
ENC failed with error CS8055: “Cannot emit debug information for a source text without encoding.”
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 6
- Comments: 20 (7 by maintainers)
@danroth27 It’s alright. What I was trying to say is: Running without the debugger works properly (As I told in https://github.com/aspnet/AspNetCore/issues/11489#issuecomment-505330487). Like you pointed out in the comment I quoted above: The support for complete live reload (https://github.com/aspnet/AspNetCore/issues/5456) is not yet done.
I don’t have other issues, I’m just waiting for https://github.com/aspnet/AspNetCore/issues/5456 to be done 😃
Edit: @danroth27 Now I understand why you asked. In my case it was not some error in the .cs class but in a razor page. Sorry for that confusion.
This is fixed in VS 2019 16.1 Preview 1
FYI, I added that workaround to my launchsettings.json and it did not make any difference in my experience.
This is something that @BillHiebert should look at not @NTaylorMullen