aspnet / Tooling

Issue tracker and info on Visual Studio tooling for ASP.NET
Other
256 stars 124 forks source link

RC2: VS Crash when trying to publish to Azure #483

Open natelaff opened 8 years ago

natelaff commented 8 years ago

Not sure where to put this so it landed here.

Got my ASP.net web app updated to RC2. Everything is working great, but I can't publish to Azure without Visual Studio crashing.

It spins on "Discovering Data Contexts" then eventually goes down. It seems to not be able to find my context/connection string but I'm not sure why. I'm thinking it's because it's defined as such:

public class ApplicationDbContext : IdentityDbContext< User, IdentityRole <Guid>, Guid>
{

Creating a new project works fine... don't see any glaring differences other than how I define this thing... but even trying it there worked fine.

This is the stack trace from Windows Event Viewer:

Exception Info: System.NullReferenceException at Microsoft.VisualStudio.Web.Azure.Publish.Model.SettingsTab.AppServicePublishSettingsTab.GetConnectionStrings(Microsoft.VisualStudio.Web.Internal.Contracts.IAzureWebSiteInternal) at Microsoft.VisualStudio.Web.Azure.Publish.Model.SettingsTab.AppServicePublishSettingsTab.b__13_1(System.Threading.Tasks.Task1<Microsoft.VisualStudio.Web.Internal.Contracts.IAzureWebSiteInternal>) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2[[System.Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].InnerInvoke() at System.Threading.Tasks.Task.Execute() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) at Microsoft.VisualStudio.Web.Publish.Model.Database.DotNetCore.DotNetDatabaseSettings+d36.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) at Microsoft.VisualStudio.Web.Publish.Model.Database.DotNetCore.DotNetDatabaseSettings+d35.MoveNext() at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__6_0(System.Object) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)

vijayrkn commented 8 years ago

We were able to reproduce this error on our side. This happens when the publish dialog is not able to get the default connection string from Azure. Possible causes:

This issue will be fixed in the next Azure SDK release. Until this release is available, work around is to login to your Azure subscription from Server explorer before opening the publish dialog.

natelaff commented 8 years ago

Hmm... I don't fit any of those criteria.

My account is logged in (to server explorer and cloud explorer) and working properly there. Web app still exists and is part of the proper subscription.

I am deploying to a slot, and I have enabled two factor authentication on my Microsoft account. Perhaps one of those would also be a factor?

natelaff commented 8 years ago

Also, this worked on RC1 just fine

vijayrkn commented 8 years ago

Yes, verified that this is an issue while publishing to the slots as well. The VS crash issue (for all these cases) should be fixed in the next Azure SDK release. Thanks for reporting this issue.

natelaff commented 8 years ago

Thank you! Any idea what kind of schedule they're on? I have some decisions I need to make on what to do in the interim ;)

mlorbetske commented 8 years ago

@madmunsterdaddy we're in the process of doing our pre-release validations right now, the release will be very soon. I'm not certain if we're allowed to give specific dates, but I'd be looking for an SDK release before the end of the month.

natelaff commented 8 years ago

Awesome, that works! Thanks :)

sayedihashimi commented 8 years ago

Closing for now since I believe this is fixed.

natelaff commented 8 years ago

Was this supposed to be fixed in 2.9.1 SDK released yesterday? If so, it's still crashing Visual Studio 2015 when trying to publish to an Azure app deployment slot.

natelaff commented 8 years ago

At least it gives you an error message now before it crashes. Though I'm pretty sure its the same as the one I pulled from event viewer last week.

Unhandled exception: System.NullReferenceException Object reference not set to an instance of an object. at Microsoft.VisualStudio.Web.Azure.Publish.Model.SettingsTab.AppServicePublishSettingsTab.GetConnectionStrings(IAzureWebSiteInternal website) at Microsoft.VisualStudio.Web.Azure.Publish.Model.SettingsTab.AppServicePublishSettingsTab.b__13_1(Task1 resource) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Web.Publish.Model.Database.DotNetCore.DotNetDatabaseSettings.d36.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at Microsoft.VisualStudio.Web.Publish.Model.Database.DotNetCore.DotNetDatabaseSettings.d38.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.b__6_0(Object state) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

vijayrkn commented 8 years ago

Can you please confirm you have this version of the AppService tools installed from Help -> about Azure App Service Tools v2.9.1

natelaff commented 8 years ago

Hmm... that reports 2.9.

But when I run VWDOrVs2015AzurePack.exe it reports I have 2.9.1 installed.

natelaff commented 8 years ago

1

2

Am I missing something to get VS App Service Tools updated?

vijayrkn commented 8 years ago

@joeloff - Can you please help with this setup issue? Installing SDK2.9.1 doesn't seem to install AppService tools 2.9.1 on the above machine.

stephanjohnson commented 8 years ago

I have the exact same error, I have updated to the lasted Azure App Service Tools (2.9.1) released on the 24th May 2016.

I have even tried downloading the publish profile instead of pulling the publish details in using Visual Studio. FTP Publish does not work either.

I am also properly logged into Azure via Visual Studio.

stephanjohnson commented 8 years ago

It is important to note that another site I have publishes just fine without any issues. It is also AspNetCore RC2, and publishes without a deployment slot.

The site in question that keeps failing is publishing to a deployment slot.

joeloff commented 8 years ago

I'll need to see the WebPI installation logs.

stephanjohnson commented 8 years ago

Here are mine

webpi5.txt

joeloff commented 8 years ago

Thanks @stephanjohnson Looks like a problem with the WebPI feed. The feed didn't bring in the missing component.

stephanjohnson commented 8 years ago

Awesome, is there anyway to install the components manually? Or is it a quick/easy fix on your side of things to get the feed updated?

joeloff commented 8 years ago

The feed will take a while to fix to track down where it failed exactly. The quick fix would be to install the missing component directly.

https://download.microsoft.com/download/7/B/5/7B53AA52-9519-467C-8DC7-1A1FF72500D9/WebToolsAzure2015.exe

joeloff commented 8 years ago

@stephanjohnson quick question. How did you install the SDK? Did you click on the notification for the update in Visual Studio or go to the Azure site directly?

natelaff commented 8 years ago

In my case I went to the Azure site and pulled down VWDOrVs2015AzurePack.exe

natelaff commented 8 years ago

The good news is 2.9.1 does indeed fix the original issue (using joeloff's link). Now you're just got the issue where it doesn't install right :)

stephanjohnson commented 8 years ago

I had no notifications, so I opened Web Platform Installer and installed it right from there.

joeloff commented 8 years ago

Ok. Did any of you try to rerun the SDK install? Unfortunately, WebPI doesn't log when dependencies are skipped, and looking at the file @stephanjohnson sent me, it just skipped Azure App Service. This typically happens if it believes the product is already installed.

stephanjohnson commented 8 years ago

Success, downloading the installer from https://download.microsoft.com/download/7/B/5/7B53AA52-9519-467C-8DC7-1A1FF72500D9/WebToolsAzure2015.exe worked like a charm, my publish just worked

natelaff commented 8 years ago

I didn't try to re-run the Azure SDK. After it said it was installed but not showing that way in VS I awaited further instruction. Had you not posted the link to the WebTools setup I would have been uninstalling and trying that way.

ghost commented 8 years ago

For me it also crashes when i press "Publish" with Core RTM. No error messages. Works with fresh sample project. It worked the last time I tried. Now no suggestions from the web help.

I have the latest updates and I'm logged onto Azure.

this is the error I see in the Event Viewer:

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException
   at System.Windows.Window.set_DialogResult(System.Nullable`1<Boolean>)
   at Microsoft.VisualStudio.Web.Publish.PublishUI.PublishDialog.PublishButton_Click(System.Object, System.Windows.RoutedEventArgs)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
   at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
   at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
   at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
   at System.Windows.UIElement.ReRaiseEventAs(System.Windows.DependencyObject, System.Windows.RoutedEventArgs, System.Windows.RoutedEvent)
   at System.Windows.UIElement.OnMouseUpThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
   at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
   at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
   at System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
   at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs, Boolean)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
   at System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr, System.Windows.Input.InputMode, Int32, System.Windows.Input.RawMouseActions, Int32, Int32, Int32)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr, MS.Internal.Interop.WindowMessage, IntPtr, IntPtr, Boolean ByRef)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
mlorbetske commented 8 years ago

Hi @nklap, sorry to hear you're running in to this. While this issue has a different cause, @vijayrkn has just added some extra safeguards to this area to prevent the crash you're seeing. Vijay, could you take a look at this and see if there's a workaround?

Zaid-Safadi commented 8 years ago

Hi @nklap did you find a solution for this or a workaround?

If not, is there an issue # tracking this? I'm having the same problem and event log when I press publish to Azure for an asp.net core web application. Visual Studion 2015 Update 3 crashes immediately.

LRomano72 commented 7 years ago

Please reopen this as it still occurs in VS 2017 latest release. Can reproduce when we have large project files and a lot of configurations. Release versions below there it just hangs:

Microsoft Visual Studio Enterprise 2017 Version 15.1 (26403.7) Release VisualStudio.15.Release/15.1.0+26403.7 Microsoft .NET Framework Version 4.6.01590

Installed Version: Enterprise

Visual Basic 2017 00369-60000-00001-AA511 Microsoft Visual Basic 2017

Visual C# 2017 00369-60000-00001-AA511 Microsoft Visual C# 2017

ASP.NET and Web Tools 2017 15.0.30320.0 ASP.NET and Web Tools 2017

ASP.NET Web Frameworks and Tools 2017 5.2.50303.0 For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 15.0.30209.0 Azure App Service Tools v3.0.0

Azure Data Lake Node 1.0 This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio 2.2.5000.0 Microsoft Azure Data Lake Tools for Visual Studio

Common Azure Tools 1.9 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Fabric.DiagnosticEvents 1.0 Fabric Diagnostic Events

JavaScript Language Service 2.0 JavaScript Language Service

KofePackagePackage Extension 1.0 KofePackagePackage Visual Studio Extension Detailed Info

Microsoft Azure Hive Query Language Service 2.2.5000.0 Language service for Hive query

Microsoft Azure Tools 2.9 Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.50131.1

Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers

NuGet Package Manager 4.1.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Redgate ReadyRoll 1.13.23.3401 Extend DevOps processes to your SQL Server databases and safely automate database deployments.

Visit https://www.red-gate.com/readyroll for more information.

Copyright (C) 2011 Red Gate Software Ltd. All rights reserved.

This software contains components from Component Owl. SQL Server is a registered trademark of Microsoft Corporation. Visual Studio is a registered trademark of Microsoft Corporation.

ReadyRoll contains code from the following open source software:

NuGet https://www.nuget.org/ SQL LocalDB Wrapper https://github.com/martincostello/sqllocaldb Autofac https://autofac.org/ Json.NET https://json.net/ MahApps.Metro http://mahapps.com/ SemVer https://github.com/maxhauser/semver Menees Diff Controls http://www.menees.com/ Log4Net http://logging.apache.org/log4net/ Extended WPF Toolkit https://wpftoolkit.codeplex.com/ Code InfoBox VSX http://www.codeproject.com/Articles/55196/Code-InfoBox-Visual-Studio-Extension-VSX OctoPack https://github.com/OctopusDeploy/OctoPack SQLite https://sqlite.org/

This product contains icons from http://www.visualpharm.com distributed under a free backlink license.

For license details or other notices relating to the above software, please see NOTICE.TXT and EULA.rtf in the ReadyRoll application folder.

Redgate SQL Prompt 7.4.1.1025 Write, format, and refactor SQL effortlessly

Redgate SQL Search 2.4.1.1284 Search functionality for SQL Server databases, from within Visual Studio

SQL Server Data Tools 15.1.61702.140 Microsoft SQL Server Data Tools

ToolWindowHostedEditor 1.0 Hosting json editor into a tool window

TypeScript 2.1.5.0 TypeScript tools for Visual Studio

Web Extension Pack 2017 15.0.2 The easiest way to set up Visual Studio for the ultimate web development experience.

mlorbetske commented 7 years ago

@vijayrkn can you take a look at this please?

LRomano72 commented 7 years ago

Full details, recordings and steps are here: [Developer Community] Fiona Niu - MSFT edited "publish as Azure Webjob just hangs"

http://emailtracking.azure.com/f/a/eT_W9cTgREcpPMqRPJQeRQ~~/AAAo6wA~/RgRa2T34P0EIACx7sgYmTlZXA3NwY1gEAAAAB1kIdnNjb21tdW5hCHZzY29tbXVuYA0zNS4xNjcuMjE1LjE5QgoAAHgK-FiaYL9mUg9MZVJvbWFub0BiZG8uY2EJUQQAAAAARGlodHRwczovL2RldmVsb3BlcmNvbW11bml0eS52aXN1YWxzdHVkaW8uY29tL2NvbnRlbnQvcHJvYmxlbS80NjM5Ny9wdWJsaXNoLWFzLWF6dXJlLXdlYmpvYi1qdXN0LWhhbmdzLmh0bWxHAnt9

Thanks,

Leo


From: Mike Lorbetskemailto:notifications@github.com Sent: ‎2017-‎04-‎19 10:03 PM To: aspnet/Toolingmailto:Tooling@noreply.github.com Cc: Leo Romanomailto:romano@leoromano.com; Commentmailto:comment@noreply.github.com Subject: Re: [aspnet/Tooling] RC2: VS Crash when trying to publish to Azure (#483)

@vijayrknhttps://github.com/vijayrkn can you take a look at this please?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/aspnet/Tooling/issues/483#issuecomment-295543617, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABsuIl-ISQwPlZsgnUnZZ3B9AIvBehZzks5rxrzagaJpZM4If3nk.