VS2017 15.6.6 ON PUBLISH TO AZURE: Microsoft.Build.Shared.InternalErrorException: MSB0001: Internal MSBuild Error: Task Instance should be null
Publishing .net core mvc to azure fails after build
When initiating publish to Azure from within Visual Studio 2017 15.6.6 it builds correctly. Just in the moment when it starts the publishing process it fails with a rather not helpful error message:
One or more errors occured
The Application compiles and runs perfectly fine locally and even if y publish it by hand to Azure it works with no issues.
VS Output Window: ========== Build: 1 succeeded, 0 failed, 7 up-to-date, 0 skipped ========== ========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
the VS error list is empty. The VS Error Message points to a temp file.
Log File in Temp directory:
"23.04.2018 08:09:25
System.AggregateException: Mindestens ein Fehler ist aufgetreten. ---> System.Exception: Fehler beim Veröffentlichen aufgrund von Buildfehlern. Überprüfen Sie die Fehlerliste auf weitere Details.
--- Ende der internen Ausnahmestapelüberwachung ---
bei System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
bei System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
bei Microsoft.VisualStudio.Web.Publish.PublishService.VsWebProjectPublish.<>c__DisplayClass40_0.<PublishAsync>b__2()
bei System.Threading.Tasks.Task1.InnerInvoke()
bei System.Threading.Tasks.Task.Execute()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei Microsoft.VisualStudio.ApplicationCapabilities.Publish.ViewModel.ProfileSelectorViewModel.
MSBuild_de291e9e-0db7-4f0e-9622-1185230b6c28.failure in my Temp Directory:
"23.04.2018 08:09:25
Microsoft.Build.Shared.InternalErrorException: MSB0001: Internal MSBuild Error: Task Instance should be null
bei Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Exception innerException, Object[] args)
bei Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.CleanupForTask()
bei Microsoft.Build.BackEnd.TaskBuilder.
Project file
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="IdentityServer4" Version="2.2.0" />
<PackageReference Include="IdentityServer4.AspNetIdentity" Version="2.1.0" />
<PackageReference Include="IdentityServer4.EntityFramework" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.7" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Tricon360.Web.TagHelpers\Tricon360.Web.TagHelpers.csproj" />
</ItemGroup>
</Project>
Expected behavior
It should publish my app to Azure
Actual behavior
It fails
Environment data
msbuild /version output:
OS info: Windows 10 Pro 1709 16299.371
If applicable, version of the tool that invokes MSBuild (Visual Studio, dotnet CLI, etc): Visual Studio 2017 15.6.6 .net core SDK 2.1.105
Hi all,
May I say that this is a very frustrating issue for me, as this used to work for me on and off with previous VS2017 Versions. (There were always periods of problems up from Visual Studio 2017)
I should add that I can perfectly publish to a local folder and from there via FTP to Azure.
It is only when publishing to Azure that I get this exception. For both my asp.net core projects in my solution.
FTP however is not a good option as I have to halt the app service in order to not miss files due to file lock issues. Also the fact that the servers are not 100% in sync time wise I always have to do a full ftp publish which depending on the Network I am on may take up to 2 hours.
Another thing I noticed:
If I Create a new ASP.NET Core Project and publish it as is without touching it, it works. So it doesn't seem to be that there is a general issue.
What I have done so far:
-
I have recreated the project I reported from scratch. Which was quite some work but I wanted to see if it could be solved like this. It can't.
-
I have double and Triple checked all Views in order to see if it could be a compilation issue, which I noticed if in release build also won't through meaningful exceptions. So I always do a debug publish beforehand to catch those if there are any. The views compile fine.
-
I have double checked that all packages are up to date.
-
I have removed all Typescript dependencies as this has caused similar issues on previous occasions (also not recently) and I am not using Typescript at present (although I would like to).
-
I have deactivated all WebCompliling of JS and LESS prior to build in order to avoid possible interference with the build process. I never the less also double checked that there are no missing files in the web compiler config file.
-
I have completely removed all references to ApplicationInsights and TelemetryClient and have deactivated the service on Azure and also removed the resource group, just to make sure that the issue is not there.
-
I have disconnected all references between Azure and VS Online. I also hace removed previous continuous delivery options from Visual Studios, including the corresponding Azure slots in order to be as simple as possible. I also have recreated the App Services (which in self was a pain for having to re-associate all domains etc...)
-
Endless times I have re-created the publish profiles not using any fancy option.
I NEED HELP!!!!
I have the same issue. Did you find a solution?
Not that only one that I could point to.
What worked was publishing local and then via FTP.
Then, just before completely going nuts I deleted my Azure App Service and made a factory re-set on my mashine. But that did not kill the issue either.
I then decided to try a new local publish and FTP publishing to azure. And after this I gave it another try to publish to azure directly and all of a suddon it works.
I was a week or so stuck on this.
It was the third time that I was facing an issue like this. This was so annoying not to get a decent exception and no help at all.... It always happened after a VS Upgrade....