Why doesn't ClickOnce in Visual Studio deploy content files from dependent assemblies?

后端 未结 5 1736
一个人的身影
一个人的身影 2020-11-30 08:58

I have a smart client application that is deployed via click once. The problem is that i have content files in dependent assemblies that just don\'t show up in the publishe

5条回答
  •  长情又很酷
    2020-11-30 09:45

    Adding this to the bottom of your .csproj / .vbproj fixes this issue. It takes the already cached target items of depending projects and explicitly adds them to the application manifest, which is then also published in the distribution manifest

    
    
      
      
    
        
      
    
      
        
        <_AllImportedCopyItems KeepDuplicates="false" KeepMetadata="CopyToOutputDirectory;TargetPath" Include="@(_AllChildProjectItemsWithTargetPath->'%(FullPath)')" Condition="'%(_AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='Always' or '%(_AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'" />
    
        
        <_AllReferenceAutoCopyItems KeepDuplicates="false" KeepMetadata="CopyToOutputDirectory;TargetPath" Include="@(ReferenceCopyLocalPaths)"/>
      
      
        
        <_AllChildProjectItemsWithTargetPath Remove="@(_AllChildProjectItemsWithTargetPath)"/>
      
      
        
        <_AllReferenceAutoCopyItems Remove="%(_AllReferenceAutoCopyItems.Identity)" Condition="'%(_AllReferenceAutoCopyItems.Extension)' != '.dll'" />
    
        
        <_AllReferenceAutoCopyItems Remove="@(_DeploymentManifestFiles);@(_DeploymentManifestDependencies)" />
      
    
      
      
        
      
      
        <_AllReferenceAutoCopyItems Remove="@(_Temporary)" />
        <_AllReferenceAutoCopyItems Include="@(_Temporary)" />
        <_Temporary Remove="@(_Temporary)" />     
      
    
      
      
        <_DeploymentManifestFiles Include="@(_AllImportedCopyItems)">
          True
          false
        
        <_DeploymentManifestFiles Include="@(_AllReferenceAutoCopyItems)">
          True
          false
        
          
      
      
        <_AllImportedCopyItems Remove="@(_AllImportedCopyItems)" />
        <_AllReferenceAutoCopyItems Remove="@(_AllReferenceAutoCopyItems)" />
      
    
    

    I'm thinking about publishing this feature in a .NuGet package, to make it easier to install this script. I will post a link when I have one.

提交回复
热议问题