TheMajidz
TheMajidz

Reputation: 19

VS2019 New Project Templates Not Loading in v16.8.1

I recently updated my vs2019 to latest version (16.8.1) but after completed update , I realized on create new project , new project templates has been not loading ! and I get this message :

screen shot from error

click to enlarge

I tried repair vs but it did not work :( Before the update, nothing was wrong !

EDIT : I checked activitylog.xml but It was useless !

EDIT2 : There is activitylog.xml : Download

EDIT 3 : I repaired Visual Studio for the second time, but I still have the same problem!

EDIT 4 : I still can use command line for create project or run or ... . only Visual Studio have problem

Upvotes: 1

Views: 775

Answers (2)

TheMajidz
TheMajidz

Reputation: 19

A new update was released a few hours ago (v16.8.2) and I just updated VS2019 from v16.8.1 to v16.8.2 And all the problems were solved :) Thanks for guys who answered .

Upvotes: 0

magicandre1981
magicandre1981

Reputation: 28766

the xml shows the cause:

Microsoft.TemplateEngine.Utils.EngineInitializationException: Error parsing the user settings file 
---> Newtonsoft.Json.JsonReaderException: Error reading JObject from JsonReader. Path '', line 0, position 0.    
at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)    
at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)    
at Microsoft.TemplateEngine.Edge.Settings.SettingsLoader.EnsureLoaded()    
--- End of inner exception stack trace ---    
at Microsoft.TemplateEngine.Edge.Settings.SettingsLoader.EnsureLoaded()    
at Microsoft.TemplateEngine.Edge.Settings.SettingsLoader.get_Components()    
at Microsoft.TemplateEngine.IDE.Bootstrapper.Register(Assembly assembly)    
at Microsoft.VisualStudio.TemplateEngine.Shared.Host.TemplateEngineBootstrapperFactory.TemplateEngineBoostrapper.Register(Assembly assembly)    
at Microsoft.VisualStudio.TemplateEngine.TemplateEngineHostManager.InitializeEngine()

So the settings.json from %HOMEPATH%\.templateengine\vs\ is somehow corrupted.

enter image description here

As you see I have 3 of them for 16.7, 16.8.0 and 16.8.1. So it looks like the file is generated each time after VS update.

You could try to repair it:

dotnet new --debug:reinit

If this doesn't fix it, report it to Microsoft so that it could be fixed.

Upvotes: 2

Related Questions