Base solution for your next web application
Open Closed

Unable to published after updating VS 2022 to latest version 17.1.1 #10965


User avatar
0
shedspotter created

What is your product version? 11.0.0

What is your product type (Angular or MVC)? Angular

What is product framework type (.net framework or .net core)? .NET 6

Hi yestarday I have updated the VS 2022 to the latest version 17.1.1, after this I am unable to published , I am getting

The "KillAppInsideContainer" task failed unexpectedly. System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:***** Projects*******\aspnet-core\src\SmartSuite.Web.Host\obj\Container\ContainerToolsExceptions.json'. and also I am not using docker

8>------ Build started: Project: SmartSuite.Web.Host, Configuration: Release Any CPU ------ 8>D:**\aspnet-core\src\SmartSuite.Web.Host\Startup\AuthConfigurer.cs(32,34,32,43): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. 8>D:\****** Projects*\aspnet-core\src\SmartSuite.Web.Host\Controllers\SharedController.cs(85,42,85,49): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. 8>D:\* Projects*\aspnet-core\src\SmartSuite.Web.Host\Startup\Startup.cs(123,13,123,66): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. 8>D:\* Projects*\aspnet-core\src\SmartSuite.Web.Host\Startup\Startup.cs(295,17,295,53): warning CS0618: 'HangfireApplicationBuilderExtensions.UseHangfireServer(IApplicationBuilder, BackgroundJobServerOptions, IEnumerable<IBackgroundProcess>, JobStorage)' is obsolete: 'Please use IServiceCollection.AddHangfireServer extension method instead in the ConfigureServices method. Will be removed in 2.0.0.' 8>SmartSuite.Web.Host -> D:* Projects*\aspnet-core\src\SmartSuite.Web.Host\bin\Release\net6.0\SmartSuite.Web.Host.dll 8>Done building project "SmartSuite.Web.Host.csproj". 9>------ Publish started: Project: SmartSuite.Web.Host, Configuration: Release Any CPU ------ C:\Users*.nuget\packages\microsoft.visualstudio.azure.containers.tools.targets\1.14.0\build\Container.targets(149,5): Error CTC1002: Visual Studio container tools require Docker Desktop. To get it, see https://go.microsoft.com/fwlink/?linkid=847268 C:\Users*.nuget\packages\microsoft.visualstudio.azure.containers.tools.targets\1.14.0\build\Container.targets(149,5): Error MSB4018: The "KillAppInsideContainer" task failed unexpectedly. System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:* Projects**\aspnet-core\src\SmartSuite.Web.Host\obj\Container\ContainerToolsExceptions.json'. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost) at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost) at Microsoft.VisualStudio.Containers.Tools.Tasks.ContainerBuildTask.OutputAndLogContainerToolsException(ContainerToolsException ex) at Microsoft.VisualStudio.Containers.Tools.Tasks.ContainerBuildTask.<EvaluateBuildPrerequisitesAsync>d27.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Containers.Tools.Tasks.ContainerBuildTask.<ExecuteAsync>d26.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Containers.Tools.Tasks.ContainerBuildTask.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

Please help me asap Thanks


13 Answer(s)
  • User Avatar
    0
    sedulen created

    Hi @shedspotter,

    I recently upgraded from Visual Studio 2019 to Visual Studio 2022 (Community Edition), and unfortunately I haven't experienced the issue that you are encountering.

    Maybe this is related? https://stackoverflow.com/questions/71269358/in-visual-studio-2022-publish-to-iis-returns-a-build-error-but-publish-to-fold

    -Brian

  • User Avatar
    0
    shedspotter created

    Hi @sedulen , yes this was the same issue which is in stack overflow but the solution is not working and I am using VS 2022 17.1.1 and latest asp net zero code

  • User Avatar
    0
    sedulen created

    @shedspotter ,

    I realize it's a tangent to your question, but would it be possible to address some of the warnings, just to try and give you a clean build ouput?

    8>D:**\aspnet-core\src\SmartSuite.Web.Host\Startup\AuthConfigurer.cs(32,34,32,43): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. 8>D:\****** Projects*\aspnet-core\src\SmartSuite.Web.Host\Controllers\SharedController.cs(85,42,85,49): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. 8>D:\* Projects*\aspnet-core\src\SmartSuite.Web.Host\Startup\Startup.cs(123,13,123,66): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. 8>D:\* Projects*\aspnet-core\src\SmartSuite.Web.Host\Startup\Startup.cs(295,17,295,53): warning CS0618: 'HangfireApplicationBuilderExtensions.UseHangfireServer(IApplicationBuilder, BackgroundJobServerOptions, IEnumerable<IBackgroundProcess>, JobStorage)' is obsolete: 'Please use IServiceCollection.AddHangfireServer extension method instead in the ConfigureServices method. Will be removed in 2.0.0.'

    I'm sure those aren't the root cause of your issue, but when looking at build outputs and exceptions, it just helps to keep the logs clean. Speaking from difficult personal experience, those async methods lacks 'await' statements shouldn't be taken lightly. So just from 1 programmer to another, as a friendly recommendation, don't leave those async warnings 'til the end.

    Secondly Would it be possible to see your .csproj file for your .Web.Host project?

    And Lastly, even though you said you aren't using Docker, would you be able to install Docker Desktop? C:\Users*.nuget\packages\microsoft.visualstudio.azure.containers.tools.targets\1.14.0\build\Container.targets(149,5): Error CTC1002: Visual Studio container tools require Docker Desktop. To get it, see https://go.microsoft.com/fwlink/?linkid=847268

    If you aren't going to be using Docker, I don't think you should have to install it, as it just adds bloat to your machine. So I'm not saying that's the best solution. Just looking at possible ways around the error for you.

    -Brian

  • User Avatar
    0
    ismcagdas created
    Support Team

    Also, could you check if you have a reference to Microsoft.VisualStudio.Azure.Containers.Tools.Targets in any of the csproj files ?

  • User Avatar
    0
    shedspotter created

    Hi @ismcagdas, Yes I have the refrence of that nuget package reference in two porjects one is in .host and another one is in public project

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @shedspotter

    Is it possible to remove those packages and try again ? As I can see, AspNet Zero doesn't have those packages by default.

  • User Avatar
    0
    shedspotter created

    Hi yes after removing that it is working and also I'll let you know that , we get "Microsoft.VisualStudio.Azure.Containers.Tools.Targets" package by default in AspNet Zero solution

    you can also check https://github.com/aspnetzero/aspnet-zero-core/blob/v11.1.0/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Host/MyCompanyName.AbpZeroTemplate.Web.Host.csproj

    Thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Thanks, sorry it is my mistake. Could you add that package back and upgrade to latest visual studio and see if it works ?

  • User Avatar
    0
    shedspotter created

    Hi @ismcagdas If I am adding Microsoft.VisualStudio.Azure.Containers.Tools.Targets in latest vs2022 version , I am getting the error which I have already mentioned in at starting

    Thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @shedspotter

    Thanks. Please remove it from your project temporarirly. We will check this problem. Please follow https://github.com/aspnetzero/aspnet-zero-core/issues/4348

  • User Avatar
    0
    m.aliozkaya created
    Support Team

    Hi @shedspotter

    Can you tell me where you published your project? (Folder, azure or docker)

  • User Avatar
    1
    shedspotter created

    Hi @krai we are publishing it in azure

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks @shedspotter

    We will work on this on our side. You can follow the https://github.com/aspnetzero/aspnet-zero-core/issues/4348 for the fix.