Edit and Continue failed in ASP.NET Core web project
See original GitHub issueDescribe 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.”
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:20 (7 by maintainers)
Top Results From Across the Web
`Enable Edit and Continue` option does not work in ASP. ...
1.Add Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation NuGet package to the project. 2.Add the following in Program.cs: builder.Services.
Read more >Edit and continue not working for asp.net core 3.0 with VS ...
I created another ASP.Net core web application with .Net Core 3.0 and experienced same issue. Edit and Continue checkbox is checked under Tools- ......
Read more >VS 2022: Edit and continue isn't working.
Since recently upgrading to VS 2022, I cannot edit when in debug/break without being prompted: Edits were made which cannot be compiled.
Read more >16.9.1 and 16.9.2 Edit And Continue Broken after upgrade
Create new ASPnet MVC project. Set Breakpoint in HomeController's Index -> on break, eg add a varialbe -> continue Stop WebApp Got to...
Read more >Edit running code with Hot Reload - JetBrains Rider
Hot Reload, also known as Edit & Continue. Learn how to make changes while running and debugging without restarting the session.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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