question

ChrisJUNGE-9783 avatar image
0 Votes"
ChrisJUNGE-9783 asked AnnaXiu-MSFT commented

Open HTML files in IDE editor

I created a ASP.NET Core project with Visual Studio 2019 and I added a .html file. When I double click on the file, VS only opens it in edge, instead of opening it in editor. When I drag and drop the file on the editor windows, it's still the same.

When I add a .txt file to the project, it gets opened in the default windows 10 text editor.

How can I open html project files in VS editor by default?

vs-general
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi ChrisJUNGE-9783, have you tried to create a new project and check if the situation occurs in specific project? Is the repair useful? Please update your VS to the latest version and try again.

0 Votes 0 ·

1 Answer

SimpleSamples avatar image
1 Vote"
SimpleSamples answered ChrisJUNGE-9783 commented

What happens when you right-click on the HTML file in the Solution Explorer then select Open With...? Is the HTML Editor selected? If not then select it and try that. If that works then make it the default.

97657-vsopenwith.jpg



vsopenwith.jpg (24.0 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, thank you for your answer. I have tried it, but it doesn't work for me (Error message: "File could not be opened. Choose another editor"). It looks like the template files for my ASP.NET core project are corrupted. When I open the file in notepad++ I can see 190 nulls. I will try to make a repair install of VS or maybe update it.

0 Votes 0 ·