System.Data.SQLite
View Ticket
Not logged in
Ticket UUID: e796ac82c1c394db156e274fba9d1548e2b17229
Title: Publish project in Visual Studio does not copy interop files to destination
Status: Closed Type: Code_Defect
Severity: Important Priority: Blocker
Subsystem: NuGetPackage Resolution: Fixed
Last Modified: 2014-11-25 17:31:26
Version Found In: 1.0.94.0
User Comments:
anonymous added on 2014-10-17 16:04:59:
Hi,

I'm using the new Nuget package (1.0.94.0) and when I publish my project (MVC/API template) from Visual Studio the x86 and x64 folders aren't copied to publish destination.

mistachkin added on 2014-10-17 18:48:54:
I'm looking into this; however, if the "Publish" functionality in Visual Studio
does not take into account per-solution NuGet packages, this might be difficult
to fix.

anonymous added on 2014-10-18 21:33:50:
This issue also appears when creating a Post-build script to xcopy $(TargetDir)* to another folder.   

The x86 and x64 folders and interop dlls do not appear to exist before the post-build event script runs.

example:
xcopy "$(TargetDir)*.*" "$(SolutionDir)\InstallBuild" /YES

If you create a post-build script that fails, you can see that the x86 and x64 folders do not even get created in $(TargetDir)

example:
xcopy "$(TargetDir)*.*" "$(SolutionDir)\InstallBuild" /NOTAVALIDSWITCH

anonymous added on 2014-10-20 11:49:48:
Hi,

I added a new target to System.Data.SQLite.Core.targets and worked (using Visual Studio 2013).

  <Target Name="CollectSQLiteInteropFiles"
          Condition="'$(CollectSQLiteInteropFiles)' != 'false' And
                     '$(OutDir)' != '' And
                     HasTrailingSlash('$(OutDir)') And
                     Exists('$(OutDir)')">
    <ItemGroup>
      <FilesForPackagingFromProject Include="%(SQLiteInteropFiles.Identity)">
        <DestinationRelativePath>$(OutDir)%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
      </FilesForPackagingFromProject>
    </ItemGroup>
  </Target>

  <PropertyGroup>
    <PipelineCollectFilesPhaseDependsOn>
      CollectSQLiteInteropFiles;
      $(PipelineCollectFilesPhaseDependsOn);
    </PipelineCollectFilesPhaseDependsOn>
    <BuildDependsOn>
      $(BuildDependsOn);
      CopySQLiteInteropFiles;
    </BuildDependsOn>
    <CleanDependsOn>
      $(CleanDependsOn);
      CleanSQLiteInteropFiles;
    </CleanDependsOn>
  </PropertyGroup>

mistachkin added on 2014-10-20 19:31:08:
We've got similar changes on the publishWithNuGetPkg branch.  I wonder if your
changes would work better.

mistachkin added on 2014-10-22 21:30:37:
See also:

http://sedodream.com/2012/10/09/VSWebPublishHowToIncludeFilesOutsideOfTheProjectToBePublished.aspx

mistachkin added on 2014-11-08 00:06:56:
Related to [f16c93a932].

mistachkin added on 2014-11-19 00:51:51:
A candidate fix is checked in on the publishWithNuGetPkg branch, here:

   [/timeline?r=publishWithNuGetPkg]

mistachkin added on 2014-11-25 17:31:26:
Fixed on trunk via check-in [eb697cca1c].  Please let us know if this fix does not
address the issue in your environment.