Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I get this error when I try to add a Razor Page:

image

I've tried cleaning the project and even repairing Visual Studio via the installer to no avail.

Opening the indicated log, I can see at the end:

<entry>
    <record>3545</record>
    <time>2021/01/26 11:36:35.647</time>
    <type>Error</type>
    <source>Template Bootstrapper</source>
    <description>Newtonsoft.Json.JsonReaderException: Error reading JObject from JsonReader. Path &apos;&apos;, line 1, position 25.&#x000D;&#x000A;   at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)&#x000D;&#x000A;   at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)&#x000D;&#x000A;   at Microsoft.TemplateEngine.Edge.Settings.SettingsLoader.EnsureInstallDescriptorsLoaded()&#x000D;&#x000A;   at Microsoft.TemplateEngine.Edge.Settings.SettingsLoader.WriteInstallDescriptorCache()&#x000D;&#x000A;   at Microsoft.TemplateEngine.Edge.Settings.SettingsLoader.Save(TemplateCache cacheToSave)&#x000D;&#x000A;   at Microsoft.TemplateEngine.Edge.Settings.SettingsLoader.Save()&#x000D;&#x000A;   at Microsoft.TemplateEngine.Edge.Settings.ComponentManager.Save()&#x000D;&#x000A;   at Microsoft.TemplateEngine.Edge.Settings.ComponentManager.RegisterMany(IEnumerable`1 typeList)&#x000D;&#x000A;   at Microsoft.TemplateEngine.IDE.Bootstrapper.Register(Assembly assembly)&#x000D;&#x000A;   at Microsoft.VisualStudio.TemplateEngine.Shared.Host.TemplateEngineBootstrapperFactory.TemplateEngineBoostrapper.Register(Assembly assembly)&#x000D;&#x000A;   at Microsoft.VisualStudio.TemplateEngine.TemplateEngineHostManager.InitializeEngine()</description>
  </entry>
question from:https://stackoverflow.com/questions/65900657/an-error-was-encountered-while-initializing-templates-visual-studio-2019

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
783 views
Welcome To Ask or Share your Answers For Others

1 Answer

Try updating Visual Studio to the latest version. That solve our issue when we encountered the same problem


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...