Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-4214

Error in MSbuild publish of Web Project in .NET 4.8

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.16.1
    • Affects Version/s: None
    • Component/s: None
    • None

      Summary

      After update driver from version 2.12.x to version 2.16, All continuous integration build that publish web projects fails with an error. Same error happens in local publish.

      Driver version 2.16.0

      How to Reproduce

      We have a regular asp.net MVC 4.8 project that we publish with the commandline (publishing within Visual Studio works, only publish with msbuild via commandline fails)

      "C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin\msbuild.exe" "C:\dev\....\Jarvis.Web.csproj" /nologo /nr:false /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:OutDir=C:\dev\jarvis_deploy\cli /p:configuration="release"

      This commandline will fail with the error

      [error]src\packages\MSBuild.Microsoft.VisualStudio.Web.targets.14.0.0.3\tools\VSToolsPath\WebApplications\Microsoft.WebApplication.targets(187,5): Error MSB3094: "DestinationFiles" refers to 1 item(s), and "SourceFiles" refers to 2 item(s). They must have the same number of items.

      Additional Background

      The error seems to be in .target version that comes in nuget package of driver version 2.16.0, we solved temporarily the issue using a modified version of the package.

        1. 2022-06-16_10-20-51.png
          2022-06-16_10-20-51.png
          244 kB
        2. 2022-06-16_10-26-12.png
          2022-06-16_10-26-12.png
          237 kB

            Assignee:
            dmitry.lukyanov@mongodb.com Dmitry Lukyanov (Inactive)
            Reporter:
            alkampfer@nablasoft.com Gian Maria Ricci
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: