New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS2015 crash at startup with self-built NuGet 3.4.1 #2419

Closed
forderud opened this Issue Mar 30, 2016 · 17 comments

Comments

Projects
None yet
6 participants
@forderud

forderud commented Mar 30, 2016

VS2015 Update 2 consistently crashes during startup after installing NuGet plugin 3.4.1 built from the release-3.4.1 Git branch in either debug or release. Opening a project or solution is not necessary. Error information:

An unhandled exception of type 'System.TypeLoadException' occurred in mscorlib.dll

Additional information: Could not load type 'Microsoft.VisualStudio.Services.Client.Keychain.SessionTokenDescriptor' from assembly 'Microsoft.VisualStudio.Services.Client, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

I'm unfortunately not able to extract any call-stack from the crash, despite building NuGet in debug and adding NuGet PDB-files to the symbol search path. The reason for wanting to build the NuGet plugin in debug is to be able to debug an unrelated NuGet 3.4 crash related to browsing V2 sources. This is therefore a blocking issue for me.

Setup:

  • Reproducible on both Windows 7 SP1 (x64) and Windows 10 (both fully patched)
  • Visual Studio 2015 Update 2 (latest version).

@rrelyea rrelyea added this to the 3.5 Beta milestone Mar 30, 2016

@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer Mar 31, 2016

@forderud can you tell us about the first issue? Seems a bit more critical :)

I assume you crash happens around this line - https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/VsExtension/NuGetPackage.cs#L375

Commenting it out (or something around that), might get you out of jail enough to explore further

yishaigalatzer commented Mar 31, 2016

@forderud can you tell us about the first issue? Seems a bit more critical :)

I assume you crash happens around this line - https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/VsExtension/NuGetPackage.cs#L375

Commenting it out (or something around that), might get you out of jail enough to explore further

@forderud

This comment has been minimized.

Show comment
Hide comment
@forderud

forderud Mar 31, 2016

Thanks for the tip. Unfortunately, the visual studio startup crash persists, even after commenting out the VsCredentialProviderImporter object creation. The problem must therefore lie somewhere else.

It would be very helpful if someone could try to reproduce this issue.

forderud commented Mar 31, 2016

Thanks for the tip. Unfortunately, the visual studio startup crash persists, even after commenting out the VsCredentialProviderImporter object creation. The problem must therefore lie somewhere else.

It would be very helpful if someone could try to reproduce this issue.

@pspill

This comment has been minimized.

Show comment
Hide comment
@pspill

pspill Mar 31, 2016

I'm not able to repro this issue on Windows 10 + Microsoft Visual Studio Enterprise 2015 Version 14.0.25123.00 Update 2.

@forderud -- I'd like to understand how you loaded a version of Microsoft.VisualStudio.Services.Client that lacked this type. Could you see where you are loading this from and send me the dll? To do so, you can

  • Launch a developer prompt elevated
  • start fuslogvw.exe
  • clear all logs, if present
  • Settings / Log All Binds to Disk / Enable custom log path
  • Launch VS, do something with NuGet VSIX
  • in Fuslogvw, look for Microsoft.VisualStudio.Services.Client and open the entry. Where this loads from should be at the bottom of the log.

pspill commented Mar 31, 2016

I'm not able to repro this issue on Windows 10 + Microsoft Visual Studio Enterprise 2015 Version 14.0.25123.00 Update 2.

@forderud -- I'd like to understand how you loaded a version of Microsoft.VisualStudio.Services.Client that lacked this type. Could you see where you are loading this from and send me the dll? To do so, you can

  • Launch a developer prompt elevated
  • start fuslogvw.exe
  • clear all logs, if present
  • Settings / Log All Binds to Disk / Enable custom log path
  • Launch VS, do something with NuGet VSIX
  • in Fuslogvw, look for Microsoft.VisualStudio.Services.Client and open the entry. Where this loads from should be at the bottom of the log.
@forderud

This comment has been minimized.

Show comment
Hide comment
@forderud

forderud Mar 31, 2016

Microsoft.VisualStudio.Services.Client appars twice in my log when launching VS2015 U2 before the IDE crashes:
Microsoft.VisualStudio.Services.Client, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.txt
Microsoft.VisualStudio.Services.Client, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.txt

Loading fails in the first file, wheras loading succeds from C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\EXTENSIONS\XMMRW3SX.DCU\Microsoft.VisualStudio.Services.Client.dll in the second log.

forderud commented Mar 31, 2016

Microsoft.VisualStudio.Services.Client appars twice in my log when launching VS2015 U2 before the IDE crashes:
Microsoft.VisualStudio.Services.Client, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.txt
Microsoft.VisualStudio.Services.Client, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.txt

Loading fails in the first file, wheras loading succeds from C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\EXTENSIONS\XMMRW3SX.DCU\Microsoft.VisualStudio.Services.Client.dll in the second log.

@pspill

This comment has been minimized.

Show comment
Hide comment
@pspill

pspill Mar 31, 2016

Thanks @forderud. Could you please send C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\EXTENSIONS\XMMRW3SX.DCU\extension.vsixmanifest, so we can see what extension you're loading this assembly from?

pspill commented Mar 31, 2016

Thanks @forderud. Could you please send C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\EXTENSIONS\XMMRW3SX.DCU\extension.vsixmanifest, so we can see what extension you're loading this assembly from?

@forderud

This comment has been minimized.

Show comment
Hide comment

@forderud forderud changed the title from VS2015 crash at startup with NuGet 3.4.1 built in debug to VS2015 crash at startup with NuGet 3.4.1 Apr 1, 2016

@forderud forderud changed the title from VS2015 crash at startup with NuGet 3.4.1 to VS2015 crash at startup with self-built NuGet 3.4.1 Apr 1, 2016

@forderud

This comment has been minimized.

Show comment
Hide comment
@forderud

forderud Apr 1, 2016

Status update: The crash occurs both with NuGet.Tools.vsixbuilt in debug as well as release.

forderud commented Apr 1, 2016

Status update: The crash occurs both with NuGet.Tools.vsixbuilt in debug as well as release.

@pspill

This comment has been minimized.

Show comment
Hide comment
@pspill

pspill Apr 1, 2016

Thank you for all your help @forderud. You are hitting #2401. The NuGet VSIX links against Microsoft.VisualStudio.Services.Client.dll, but these assemblies should never be included in the VSIX, and they should be loaded from Team Explorer instead. You'll only see this in local builds -- the NuGet vsix released on NuGet.org are correctly filtering the list of assemblies to include in the package.

pspill commented Apr 1, 2016

Thank you for all your help @forderud. You are hitting #2401. The NuGet VSIX links against Microsoft.VisualStudio.Services.Client.dll, but these assemblies should never be included in the VSIX, and they should be loaded from Team Explorer instead. You'll only see this in local builds -- the NuGet vsix released on NuGet.org are correctly filtering the list of assemblies to include in the package.

@pspill

This comment has been minimized.

Show comment
Hide comment
@pspill

pspill Apr 4, 2016

Although this issue is caused by #2401, we ought further harden the type load in NuGet vsExtension project, so if a user ever ends up with a bad services assembly, that we fail to load the provider but don’t crash NuGet. Currently we’re handling BadImageFormatException and FileLoadException. This should also include TypeLoadException and FileNotFoundException… or consider catching Exception.

https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/VsExtension/VsCredentialProviderImporter.cs#L105

pspill commented Apr 4, 2016

Although this issue is caused by #2401, we ought further harden the type load in NuGet vsExtension project, so if a user ever ends up with a bad services assembly, that we fail to load the provider but don’t crash NuGet. Currently we’re handling BadImageFormatException and FileLoadException. This should also include TypeLoadException and FileNotFoundException… or consider catching Exception.

https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/VsExtension/VsCredentialProviderImporter.cs#L105

@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer Apr 4, 2016

@pspill do you plan on a PR for this?

yishaigalatzer commented Apr 4, 2016

@pspill do you plan on a PR for this?

@pspill

This comment has been minimized.

Show comment
Hide comment
@pspill

pspill Apr 4, 2016

Yes, we're tracking it and someone will pick up and fix. What timeframe should this be fixed in?

pspill commented Apr 4, 2016

Yes, we're tracking it and someone will pick up and fix. What timeframe should this be fixed in?

@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer Apr 5, 2016

Within the month of April will be ideal

Sent from Outlook Mobilehttps://aka.ms/xp9y6l

On Mon, Apr 4, 2016 at 3:48 PM -0700, "Peter Spillman" <notifications@github.commailto:notifications@github.com> wrote:

Yes, we're tracking it and someone will pick up and fix. What timeframe should this be fixed in?

You are receiving this because you commented.
Reply to this email directly or view it on GitHubhttps://github.com/NuGet/Home/issues/2419#issuecomment-205527679

yishaigalatzer commented Apr 5, 2016

Within the month of April will be ideal

Sent from Outlook Mobilehttps://aka.ms/xp9y6l

On Mon, Apr 4, 2016 at 3:48 PM -0700, "Peter Spillman" <notifications@github.commailto:notifications@github.com> wrote:

Yes, we're tracking it and someone will pick up and fix. What timeframe should this be fixed in?

You are receiving this because you commented.
Reply to this email directly or view it on GitHubhttps://github.com/NuGet/Home/issues/2419#issuecomment-205527679

@yishaigalatzer yishaigalatzer modified the milestones: 3.5 Beta, 3.5 RC Apr 8, 2016

@leppie

This comment has been minimized.

Show comment
Hide comment
@leppie

leppie Apr 14, 2016

Just got this after my Community version was update to Pro at work. Nuget 3.4.2.

Crashes on normal startup, VS not usable.

Experimental instance does work.

Edit: Seems this might be caused by something else...

Edit: Still have no idea what is causing this, ended up renaming the file to prevent it loading.

Edit: And a no go on that... Any chance of a hotfix/beta build so I can actually use VS?

And finally, a VS2015 repair did the trick.

leppie commented Apr 14, 2016

Just got this after my Community version was update to Pro at work. Nuget 3.4.2.

Crashes on normal startup, VS not usable.

Experimental instance does work.

Edit: Seems this might be caused by something else...

Edit: Still have no idea what is causing this, ended up renaming the file to prevent it loading.

Edit: And a no go on that... Any chance of a hotfix/beta build so I can actually use VS?

And finally, a VS2015 repair did the trick.

@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer Apr 14, 2016

So are you unblocked?

yishaigalatzer commented Apr 14, 2016

So are you unblocked?

@leppie

This comment has been minimized.

Show comment
Hide comment
@leppie

leppie Apr 14, 2016

@yishaigalatzer Yes, after VS2015 repair. Still dont know what caused it (probably not Nuget, but something else doing the same).

leppie commented Apr 14, 2016

@yishaigalatzer Yes, after VS2015 repair. Still dont know what caused it (probably not Nuget, but something else doing the same).

@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer Apr 14, 2016

Thanks a lot for the update

yishaigalatzer commented Apr 14, 2016

Thanks a lot for the update

@alpaix

This comment has been minimized.

Show comment
Hide comment
@alpaix

alpaix Apr 18, 2016

@forderud While working on #2401 I figured a VsExtension.csproj property that should help you with the exception you hit:

<IncludeCopyLocalReferencesInVSIXContainer>false</IncludeCopyLocalReferencesInVSIXContainer>

alpaix commented Apr 18, 2016

@forderud While working on #2401 I figured a VsExtension.csproj property that should help you with the exception you hit:

<IncludeCopyLocalReferencesInVSIXContainer>false</IncludeCopyLocalReferencesInVSIXContainer>

alpaix added a commit to alpaix/NuGet.Client that referenced this issue Apr 19, 2016

Added include and ignore lists to VSIX build
Fixes NuGet/Home#2401.
Fixes NuGet/Home#2419.
Fixes NuGet/Home#2546.

- Added files with include and ignore files lists matching CI script.
- Integrated include and ignore lists validation into VSIX build project.
- Removed redundant dependencies and added missing ones.

alpaix added a commit to alpaix/NuGet.Client that referenced this issue Apr 27, 2016

Added include and ignore lists to VSIX build
Fixes NuGet/Home#2401.
Fixes NuGet/Home#2419.
Fixes NuGet/Home#2546.

- Added files with include and ignore files lists matching CI script.
- Integrated include and ignore lists validation into VSIX build project.
- Removed redundant dependencies and added missing ones.

alpaix added a commit to NuGet/NuGet.Client that referenced this issue Apr 28, 2016

Added include and ignore lists to VSIX build
Fixes NuGet/Home#2401.
Fixes NuGet/Home#2419.
Fixes NuGet/Home#2546.

- Added files with include and ignore files lists matching CI script.
- Integrated include and ignore lists validation into VSIX build project.
- Removed redundant dependencies and added missing ones.

@alpaix alpaix assigned alpaix and unassigned pspill Apr 28, 2016

@alpaix alpaix added this to the 3.5 Beta2 milestone Jun 9, 2016

@alpaix alpaix removed this from the 3.5 RC milestone Jun 9, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment