Cannot Git Diff CSHTML Files in Visual Studio 2015

I am using Visual Studio 2015 with ASP.Net MVC 6 on Windows 10. As far as I can tell, everything is up to date, but I have not changed anything recently that I know of. Over the past couple of days, Visual Studio has stopped letting me compare the current version of the * .cshtml file to see what changes I made. It works for any other type of files I tried, only these problems are the problem.

I get the error "Failed to start the configured comparison tool." I saw a couple of other messages (for example: Visual Studio 2015 using Git unable to compare files and Microsoft Git Provider and Visual Studio 2012 could not start the configured comparison tool ), but they seem to be talking more generally, they cannot distinguish from any problem. what i don't see. It's almost as if Git (or VS?) Decided to choose this particular file type so as not to like it.

I tried to create a new ASP.NET project with a new Git repository and it sees the same problem and the problem disappears if I rename the .cshtml file to give it a different extension. I looked at the .gitattributes file, but I can’t see anything, although to be honest, I really don’t understand how Git works outside of the base “this is how you manage it when it works”, I also tried to uninstall and reinstall all Git, which can be found on my PC without joy.

Anyone have any ideas on what I could break?

Update: I just found this https://github.com/aspnet/Tooling/issues/293 , which suggests that it might be related to the ASP.Net update. I think I will probably have to wait and see.

+5
source share
3 answers

This turned out to be a problem with the new ASP.Net tool. They apparently have a fix that needs to be done, but until then there is a workaround:

In the options bar, open "Options-> Text Editor-> HTML-> Advanced Set the identification files with useful extensions to False

This corresponds to https://github.com/aspnet/Tooling/issues/293#issuecomment-161382206

+2
source

Clearing the MEF cache also fixes this. Close the IDE and delete the contents of this directory:

%LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache

Clearing the MEF component cache (Open VSIX Gallery) is also likely to help.

Probably refers to fooobar.com/questions/36383 / ...

+11
source

Check the .gitignore file for links to .cshtml files. Donut dollars, something like * .cshtml in this particular repo. Can you run diff in git outside of VS?

0
source

Source: https://habr.com/ru/post/1236986/


All Articles