3

Crash on Azure publish from Visual Studio. The same thing happens in previous versions of Visual Studio, but in the past I've been able to work around the bug by clearing the appdata and if necessary resorting to resetting user settings per the responses to this question about a VS2015 issue.

Azure publish has been working up to now in 2017. Suddenly I am getting the dreaded null reference, and this time clearing the aforementioned data has not helped:

enter image description here

Restarted Visual Studio, restarted machine, cleared data a second time including both roaming and local appdata, all to no avail.

Community
  • 1
  • 1
Reg Edit
  • 6,719
  • 1
  • 35
  • 46

6 Answers6

2

Just for others searching, in my case the issue was that I had previously disabled the "Microsoft VisualStudio Managed Publish" extension in VS2017 (probably in an attempt to get VS to be more responsive). To re-enable it, go to Tools > Extensions and Updates, enable it, then restart VS:

enter image description here

sellotape
  • 8,034
  • 2
  • 26
  • 30
1

Thank you for your sharing. I have the same case as you. I accidently disabled the "Microsoft VisualStudio Managed Publish" extension in VS2017. The publish menu even doesn't show up in .net core solution explorer. To re-enable it, go to Tools > Extensions and Updates, enable it, then restart VS.

YakovL
  • 7,557
  • 12
  • 62
  • 102
1

Unchecking/unselecting the Application Insights in the Publish workflow of Visual Studio 2017 fix the error for me.

Vamsi
  • 11
  • 2
0

This can be caused by a validation error in the service definition and configuration files.

Even though the editor doesn't highlight any problems, and the build completes successfully, there can be errors in these files and they are not handled properly when you attempt to publish, giving the null reference error.

I encountered this after modifying the files per these steps to configure SSL. I really wasn't expecting that to be the culprit, but in desperation I was trying everything I could think of that might be causing the problem. As soon as I commented out the change to the <certificates> element, the null reference error went away, and the publish succeeded.

(I now need to work out why the steps for SSL configuration didn't work, perhaps due to a change introduced by VS2017, but that's another story.)

Reg Edit
  • 6,719
  • 1
  • 35
  • 46
0

I was experiencing the same issue as the OP. I created a new DB Project and then compared the settings of the new DB Project with the DB Project that was causing the Null Reference Exception upon Build or Publish. I noticed that our output directory was redirected to a non-standard location. After deleting all the files in the bin folder, the Build and Publish started working. YMMV

W0GER
  • 1
0

I found a lot of answers around that -- so may be there are more than one -- but none worked for me. On my system it worked again after removing the installations for ASP.NET and Azure and installing it newly .. --> evth is fine.

mommos
  • 189
  • 5