Copy Plugin on Build not doing anything

Answered

Hi,

I have a plugin locally installed and I've got everything up and running, but just have this issue that the CopyPlugin does not copying my targeted files.

I got the following output after build which looks like the packages are identified, my plugin is in Exp experimental instance, just no file copying is happening.

1>------ Rebuild All started: Project: AssemblyDependency, Configuration: Debug Any CPU ------
1> AssemblyDependency -> C:\Projects\GitHub\ReSharper\src\AssemblyDependency\bin\Debug\AssemblyDependency.dll
1> Searching for installed products in: C:\Users\lene.wei\AppData\Local\JetBrains\Installations
1> Scanning: C:\Users\lene.wei\AppData\Local\JetBrains\Installations\Packages
1> Scanning: C:\Users\lene.wei\AppData\Local\JetBrains\Installations\ReSharperPlatformVs14Exp_000
1> packages file found: C:\Users\lene.wei\AppData\Local\JetBrains\Installations\ReSharperPlatformVs14Exp_000\packages
1> host recognized: ReSharperPlatformVs14Exp, +59 packages
1> Scanning: C:\Users\lene.wei\AppData\Local\JetBrains\Installations\ReSharperPlatformVs14Exp_001
1> Scanning: C:\Users\lene.wei\AppData\Local\JetBrains\Installations\ReSharperPlatformVs14_000
1> packages file found: C:\Users\lene.wei\AppData\Local\JetBrains\Installations\ReSharperPlatformVs14_000\packages
1> host recognized: ReSharperPlatformVs14, +59 packages
1>C:\Projects\GitHub\ReSharper\src\packages\JetBrains.ReSharper.SDK.Internal.108.0.20170428.83402\DotFiles\JetBrains.CommonSdk.targets(24,5): warning : No installed product ReSharperPlatformVs14Plugins. Available installed products: ReSharperPlatformVs14Exp, ReSharperPlatformVs14
1> InstallFolder:
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

Here's my project file related parts. I'm currently using R#2017.1, VS2015 on Windows 7.

Please can anyone kindly give me advice where I'm possibly wrong? Many thanks!

<PropertyGroup>
<HostFullIdentifier>ReSharperPlatformVs14Plugins</HostFullIdentifier>
</PropertyGroup>

<Target Name="CopyPlugin" AfterTargets="AfterBuild" Condition="'$(HostFullIdentifier)' != ''">
<InstalledProductsDiscoveryTask HostFullIdentifier="$(HostFullIdentifier)">
<Output TaskParameter="Directories" ItemName="InstallFolder" />
</InstalledProductsDiscoveryTask>
<Message Text="InstallFolder: @(InstallFolder)" Importance="High" />
<Copy SourceFiles="bin\Debug\AssemblyDependency.dll" DestinationFolder="@(InstallFolder)" Condition="Exists('@(InstallFolder)')" />
<Copy SourceFiles="bin\Debug\AssemblyDependency.pdb" DestinationFolder="@(InstallFolder)" Condition="Exists('@(InstallFolder)')" />
</Target>

 

Lene Wei

11 comments
Official comment

Hi Lene Wei!

You are specifying non-existing host identifier.

warning : No installed product ReSharperPlatformVs14Plugins. Available installed products: ReSharperPlatformVs14Exp, ReSharperPlatformVs14

Specify ReSharperPlatformVs14Exp instead, in HostFullIdentifier property.

Cool, thanks Salva! I forgot to change the suffix because I switched computers and change the suffix when install ReSharper again.

After I altered the suffix I got the dll file copied as expected, the pdb file however I also specified to copy doesn't get synchronized.

Any idea why? and how I can get both of them copied?

 

0

Please, provide full msbuild log - there will be some warnings from your Copy tasks.
Also, run build with Verbose logging.

0

I replied with email and looks like a ticket is generated sorry about that...

0

According to log, at the moment of copying there is no *.pdb files in bin
Task "Copy"
Task Parameter:
SourceFiles=
bin\Debug\AssemblyDependency.dll
OriginalItemSpec=obj\Debug\AssemblyDependency.dll
Task Parameter:DestinationFolder=C:\Users\lene.wei\AppData\Local\JetBrains\Installations\ReSharperPlatformVs14Exp
Copying file from "bin\Debug\AssemblyDependency.dll" to "C:\Users\lene.wei\AppData\Local\JetBrains\Installations\ReSharperPlatformVs14Exp\AssemblyDependency.dll".

Are you sure it exists after build there?

0

Seems, IncrementalClean target deletes it.
It's MsBuild bug and it's logged here https://github.com/Microsoft/msbuild/issues/1054

0

As workaround, you can copy it from obj\Debug directory.

0

oops I replied with emails again and 2 more tickets are created...
Just want to say thanks very much for your prompt help!

0

I just have time to test copying from obj\Debug, unfortunately it doesn't work either.

Turns out that the copy tag within CopyPlugin never works, I removed the copy task in CopyPlugin and the dll is copied over anyway!

I did a workaround to extend the build process, this time it works as expected.

<Target Name="CopyPlugin" AfterTargets="AfterBuild" Condition="'$(HostFullIdentifier)' != ''">
<InstalledProductsDiscoveryTask HostFullIdentifier="$(HostFullIdentifier)">
<Output TaskParameter="Directories" ItemName="InstallFolder" />
</InstalledProductsDiscoveryTask>
<Message Text="InstallFolder: @(InstallFolder)" Importance="High" />
</Target>
<Target Name="AfterCopyPlugin" AfterTargets="CopyPlugin" Condition="'$(HostFullIdentifier)' != ''">
<Copy SourceFiles="bin\Debug\AssemblyDependency.pdb" DestinationFolder="@(InstallFolder)" Condition="Exists('@(InstallFolder)')" />
</Target>

 

build result:

Target "CopyPlugin" in file "C:\Projects\GitHub\ReSharper\src\packages\JetBrain
s.ReSharper.SDK.Internal.108.0.20170428.83402\DotFiles\JetBrains.CommonSdk.targ
ets" from project "C:\Projects\GitHub\ReSharper\src\AssemblyDependency\Assembly
Dependency.csproj" (target "Build" depends on it):
Using "InstalledProductsDiscoveryTask" task from assembly "C:\Projects\GitHub\R
eSharper\src\packages\JetBrains.ReSharper.SDK.Internal.108.0.20170428.83402\Dot
Files\JetBrains.ReSharper.SDK.Helper.dll".
Task "InstalledProductsDiscoveryTask"
Searching for installed products in: C:\Users\lene.wei\AppData\Local\JetBrain
s\Installations
Scanning: C:\Users\lene.wei\AppData\Local\JetBrains\Installations\Packages
Scanning: C:\Users\lene.wei\AppData\Local\JetBrains\Installations\ReSharper
PlatformVs14Exp
packages file found: C:\Users\lene.wei\AppData\Local\JetBrains\Installati
ons\ReSharperPlatformVs14Exp\packages
host recognized: ReSharperPlatformVs14Exp, +59 packages
Scanning: C:\Users\lene.wei\AppData\Local\JetBrains\Installations\ReSharper
PlatformVs14Exp_000
Scanning: C:\Users\lene.wei\AppData\Local\JetBrains\Installations\ReSharper
PlatformVs14_000
packages file found: C:\Users\lene.wei\AppData\Local\JetBrains\Installati
ons\ReSharperPlatformVs14_000\packages
host recognized: ReSharperPlatformVs14, +59 packages
Done executing task "InstalledProductsDiscoveryTask".
Task "Message"
InstallFolder: C:\Users\lene.wei\AppData\Local\JetBrains\Installations\ReShar
perPlatformVs14Exp
Done executing task "Message".
Task "Copy"
Copying file from "bin\Debug\AssemblyDependency.dll" to "C:\Users\lene.wei\Ap
pData\Local\JetBrains\Installations\ReSharperPlatformVs14Exp\AssemblyDependen
cy.dll".
Done executing task "Copy".
Done building target "CopyPlugin" in project "AssemblyDependency.csproj".
Target "AfterCopyPlugin" in project "C:\Projects\GitHub\ReSharper\src\AssemblyD
ependency\AssemblyDependency.csproj" (target "Build" depends on it):
Task "Copy"
Copying file from "bin\Debug\AssemblyDependency.pdb" to "C:\Users\lene.wei\Ap
pData\Local\JetBrains\Installations\ReSharperPlatformVs14Exp\AssemblyDependen
cy.pdb".
Done executing task "Copy".
Done building target "AfterCopyPlugin" in project "AssemblyDependency.csproj".
0

I've the same issue. I was able to resolve it by using a proper host identifier however it doesn't overwrite old PDB file.
Is there an issue ticket to track this issue? (I'm not using incremental build)

0

Please sign in to leave a comment.