Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from 3.3.0 to 3.3.1 causes build server error #40

Open
lilmidnit opened this issue Aug 8, 2018 · 1 comment
Open

Update from 3.3.0 to 3.3.1 causes build server error #40

lilmidnit opened this issue Aug 8, 2018 · 1 comment

Comments

@lilmidnit
Copy link

I am using net462 and web application.

When packaging a web application using PackageReference and msbuild - it attemps to copy files to a temp location for deploy and it thinks it should copy the App_Start/Ninject.Web.Common.cs but it also thinks it should delete it. So it deletes it from the nuget folder, then later it tries to copy it to the deploy folder based on the file list it generated earlier.

This is all defined in Microsoft.Web.Publishing.targets

<!--Force Copy Of all file to the $(WPPAllFilesInSingleFolder) if needed-->
<CopyPipelineFiles PipelineItems="@(FilesForPackagingFromProject)"
                       SourceDirectory="$(WebPublishPipelineProjectDirectory)"
                       TargetDirectory="$(WPPAllFilesInSingleFolder)"
                       SkipMetadataExcludeTrueItems="True"
                       UpdateItemSpec="True"
                       DeleteItemsMarkAsExcludeTrue ="True"
                   Condition="'@(FilesForPackagingFromProject)' != ''">
  <Output TaskParameter="ResultPipelineItems" ItemName="_FilesForPackagingFromProjectTempory"/>
</CopyPipelineFiles>

Perhaps the bug is in the targets - but I had to roll back to 3.3.0 as I havent figured out a workaround

@Qmannn
Copy link

Qmannn commented May 17, 2024

Wow, six years ago...

We've met same issue a few days ago.

After some debugging we found how to fix this problem.
There's workaround to fix it.

Add code below to your Directory.Build.targets file.


  <Target Name="OnBeforeNinjectFixCopyAllFilesToSingleFolderForPackage" BeforeTargets="CopyAllFilesToSingleFolderForPackage">
    <ItemGroup>
      <NinjectFilesToClean Include="NinjectWebCommon.cs" />
      <FilesForPackagingFromProject Remove="@(NinjectFilesToClean)" MatchOnMetadata="Filename" />

      <NinjectFiles Include="$(_WPPDefaultIntermediateOutputPath)Nuget\**\NinjectWebCommon.cs" />
      <NinjectFiles>
        <DestinationRelativePath>%(Identity)</DestinationRelativePath>
      </NinjectFiles>
      <FilesForPackagingFromProject Include="@(NinjectFiles)" />
    </ItemGroup>
  </Target>

The problem is in the path to the content file NinjectWebCommon.cs because it contains duplicated slash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants