Error : "Copying file packages\Newtonsoft..." when publishing ASP.NET web app to IIS on Windows Server 2019 RRS feed

  • Question

  • User1167734619 posted

    I copied my working ASP.NET web app from my old Windows Server 2012 R2 to my new Windows Server 2019 but now get this error when I try to publish it to localhost.

    ------ Build started: Project: ZZZ web, Configuration: Debug Any CPU ------
    ------ Publish started: Project: ZZZ web, Configuration: Debug Any CPU ------
    Auto ConnectionString Transformed web.config into C:\Users\ME\AppData\Local\Temp\WebSitePublish\ZZZ web-1297686886\obj\Debug\CSAutoParameterize\transformed\web.config.
    Copying all files to temporary location below for package/publish:
    C:\Users\ME\AppData\Local\Temp\WebSitePublish\ZZZ web-1297686886\obj\Debug\Package\PackageTmp.
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VisualStudio\v16.0\Web\Microsoft.Web.Publishing.targets(2601,5):

    Error : Copying file packages\Newtonsoft.Json.6.0.4\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll to C:\Users\ME\AppData\Local\Temp\WebSitePublish\ZZZ web-1297686886\obj\Debug\Package\PackageTmp\packages\Newtonsoft.Json.6.0.4\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll failed.

    Could not find a part of the path 'packages\Newtonsoft.Json.6.0.4\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll'.

    Saturday, May 25, 2019 3:15 PM

All replies

  • User-1174608757 posted

    Hi doug@soft-factory.com,

    According to your description,it seems that reason for the error is missing ddl files on your.So I suggest you could do manual NuGet package restore before you publish the webapplication. NuGet Package Restore installs all a project's dependencies as listed in either the project file or packages.config. Visual Studio can restore packages automatically when a project is built. 

    Here is the link, I hope it could help you.


    Best Regards


    Monday, May 27, 2019 5:35 AM