user2713516
user2713516

Reputation: 3045

ASP.NET 5 Keeps crashing VS on project initialization

I have a solution with several MVC6 (asp.net 5) projects. Each project uses bower and npm for packages. Bower has normalize-css and jquery installed.

9 out of 10 times I start the solution, it will crash during one of the mvc project's initialization-phase. If I debug I get the following error.

An unhandled exception of type 'Newtonsoft.Json.JsonSerializationException' occurred in mscorlib.dll

Additional information: Unexpected end when deserializing object. Path 'dependencies.jquery.pkgMeta.devDependencies', line 43, position 1.

If I remove jquery from bower dependencies and have only normalize-css left I get:

An unhandled exception of type 'Newtonsoft.Json.JsonSerializationException' occurred in mscorlib.dll

Additional information: Unexpected end when deserializing object. Path 'dependencies.normalize-css.pkgMeta._release', line 39, position 1.

I have uninstalled all bower packages and the problem is fixed, but I obviously still need the packages, so when adding jquery or another package again the crashing starts again.

I am using Visual Studio 2015 Enterprise.

edit for bower.json:

  {
  "name": "ASP.NET",
  "private": true,
  "dependencies": {
    "jquery": "2.1.4",
    "normalize-css": "3.0.3"
  }
}

Upvotes: 7

Views: 638

Answers (2)

user2713516
user2713516

Reputation: 3045

It seems like fixing another bug, see my answer here: https://stackoverflow.com/a/37331585/2713516 worked wonders for the crashing. It hasn't crashed since if I recall correctly. Either way, the combination of updating all dll's (especially newtonsoft.json, including removing old versions from disk) and going through the steps suggested by @LukaszDev has definitely made a big change.

Upvotes: 0

Lukasz Mk
Lukasz Mk

Reputation: 7350

Try clean up nuget, npm and bower cache - it's help in my case:

Delete files in your user folder:

  • ..\.dnx\packages\* should be restored automatically, but please make backup first,
  • ..\.nuget\packages\* like above, please make backup first,
  • ..\AppData\Local\bower\cache\*
  • ..\AppData\Roaming\npm-cache\*
  • ..\AppData\Local\Temp\*

Of course close VS before doing this, and VS restore all packages on first running.

Also you can clean up .vs folder in your project folder - theoretically it's not related, but from my experience - it's helping with numbers VS issues.

Upvotes: 1

Related Questions