Visual Studio 2022 crashing on startup

Elias Larsen 1 Reputation point
2022-12-05T19:07:35.983+00:00

Running devenv.exe with the /Log flag yielded only two errors and a few related warnings:

   <entry>  
       <record>268</record>  
       <time>2022/12/05 18:45:37.355</time>  
       <type>Error</type>  
       <source>ClientRights</source>  
       <description>GetClientRightsToken failed to parse payload for Crtoken. Exception: System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. &#x000D;&#x000A;   at System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength)&#x000D;&#x000A;   at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)&#x000D;&#x000A;   at System.Convert.FromBase64String(String s)&#x000D;&#x000A;   at Microsoft.VisualStudio.OnlineLicensing.TokenUtilities.DecodeFromBase64UTF8String(String stringToDecode)&#x000D;&#x000A;   at Microsoft.VisualStudio.OnlineLicensing.TokenUtilities.Deserialize[T](String serializedString)&#x000D;&#x000A;   at Microsoft.VisualStudio.OnlineLicensing.TokenUtilities.DeserializeCachedClientRightsToken(String serializedToken)&#x000D;&#x000A;   at Microsoft.VisualStudio.OnlineLicensing.ClientRightsStorage.&lt;ReadClientRightsContainerAsync&gt;d__30.MoveNext()</description>  
     </entry>  

...

   <entry>  
       <record>276</record>  
       <time>2022/12/05 18:45:37.395</time>  
       <type>Warning</type>  
       <source>VisualStudio</source>  
       <description>License validation task failed unexpectedly. The application will be shutdown.</description>  
     </entry>  

...

   <entry>  
       <record>292</record>  
       <time>2022/12/05 18:45:37.525</time>  
       <type>Error</type>  
       <source>OnClientRightsComputed</source>  
       <description>System.NullReferenceException: Object reference not set to an instance of an object.&#x000D;&#x000A;   at Microsoft.VisualStudio.Shell.Connected.ConnectedUser.BaseUserSession.&lt;&gt;c__DisplayClass99_0.&lt;&lt;OnClientRightsComputed&gt;b__0&gt;d.MoveNext()</description>  
     </entry>  
     <entry>  
       <record>293</record>  
       <time>2022/12/05 18:45:37.535</time>  
       <type>Warning</type>  
       <source>VisualStudio</source>  
       <description>Performance warning: String load failed. Pkg:{871D2A70-12A2-4E42-9440-425DD92A4116} (FSharpPackage) LANG:0409 ID:6001&#x000D;&#x000A;</description>  
     </entry>  
     <entry>  
       <record>294</record>  
       <time>2022/12/05 18:45:37.607</time>  
       <type>Warning</type>  
       <source>VisualStudio</source>  
       <description>Performance warning: String load failed. Pkg:{C78CA057-CC29-421F-AD6D-3B0943DEBDFC} (Windows Forms Remote Designer Hosting Package) LANG:0409 ID:1000&#x000D;&#x000A;</description>  
     </entry>  
     <entry>  
       <record>295</record>  
       <time>2022/12/05 18:45:37.619</time>  
       <type>Warning</type>  
       <source>VisualStudio</source>  
       <description>Performance warning: String load failed. Pkg:{871D2A70-12A2-4E42-9440-425DD92A4116} (FSharpPackage) LANG:0409 ID:101&#x000D;&#x000A;</description>  
     </entry>  
     <entry>  
       <record>296</record>  
       <time>2022/12/05 18:45:37.629</time>  
       <type>Warning</type>  
       <source>VisualStudio</source>  
       <description>Performance warning: String load failed. Pkg:{AD257DB7-4B2A-4014-854C-710DF52FB056} (IntelliCodeSuggestionToolWindowPackage) LANG:0409 ID:200&#x000D;&#x000A;</description>  
     </entry>  

I have tried repairing Visual Studio via the Installer to no avail. What should I do?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,614 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Uwe Oser 100 Reputation points
    2023-01-13T14:42:21.4666667+00:00

    Observations:

    Today I had the same problem. Every time I started Visual Studio, it always shut down after 5 seconds.

    Running "devenv /log d:\tmpVS" in the "Visual Studio 2022 Developer Command Prompt v17.4.4" created an XML
    with the same Error as posted above: "The input is not a valid Base-64 string as it contains a non-base 64 character, ..."
    followed by the same Warning as posted above: "License validation task failed unexpectedly. The application will be shutdown."

    Solution:

    So I renamed the folder "C:\Users\ . . .\AppData\Local\Microsoft\VSCommon\OnlineLicensing\VisualStudio"
    and started Visual Studio. It re-created the folder and the 2 contained files.

    • Now everything works fine.

    Cause:

    I compared the new files with the original files: The original files were filled with NUL chars 0x0000. It seems that these files were overwritten when my computer was automatically shut down from sleep mode because the battery was low.

    20 people found this answer helpful.

  2. Edwin Vermeer 1 Reputation point
    2022-12-08T14:57:08.867+00:00

    I have exactly the same error for a couple of months. After doing a repair from the installer or an upgrade to the latest version if available I can startup VS once. Then the next time I start VS I get this error again.

    I tried “devenv.exe /safemode” and "devenv /resetsettings" and "devenv /resetskippkgs" in Visual Studio Command Prompt.
    running "devenv.exe /log <full path to log file>" gave me the log mentioned above.

    Maybe I should try to reset the license
    Under the menu Help, Register Visual Studio there was a warning sign that I should enter my credentials. I hope that helps.
    I can confirm that in my case I can now close and open Visual Studio without it closing by itself.

    0 comments No comments