skip to Main Content

I am unable to publish my web application. It never completes and also never gives any errors. Rebuild solution works without any issues, it is just when I try to publish to a folder that it does not work.

Web site folder: "Inetpubwwwrootmysite"
I have few ASP.NET Web Service files.

enter image description here

enter image description here

Target framework: .net 4.8
Visual Studio version: Microsoft Visual Studio Community 2022 (64-bit) – Current
Version 17.1.0

Any recommendations on what to do?

2

Answers


  1. Chosen as BEST ANSWER

    After trying everything, I finally created a PowerShell script to do the publishing for me.

    $MSBuildPath="C:Program FilesMicrosoft Visual Studio2022CommunityMSBuildCurrentBin"
    
    cd $MSBuildPath
    
    .MSBuild.exe "C:pathtoproject.sln" /p:Configuration=RELEASE /p:publishDir="$env:TEMPpathtoprojectbuild" /p:WebPublishMethod=FileSystem /p:DeployOnbuild=True /p:GenerateProjectSpecificOutputFolder=false /p:UseWPP_CopyWebApplication=true /p:PipelineDependsOnBuild=false /p:OutDir="$env:TEMPpathtoprojectbuild"  /p:DefineConstants="NET45 $oraConstant" /p:Platform="Any CPU"
    
    copy "$env:TEMPpathtoprojectbuild_PublishedWebsitesproject*" "C:finalpathPublish" -recurse -Force
    

  2. Had the same problem.
    After a ‘Clean Solution’ and a rebuild the publish worked fine.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search