Home > OS >  .NET Copy files to a specified directory where part of the path is generic user
.NET Copy files to a specified directory where part of the path is generic user

Time:10-31

Inside my .csproj I have added some post build event which copies the built files and copies them to some directory:

<Target Name="CopyDLLs" AfterTargets="Build">
    <Message Text="Executing CopyDLLs of $(ProjectName) task" Importance="High" />

    <Copy
      SourceFiles="$(TargetDir)$(ProjectName).dll;$(TargetDir)$(ProjectName).pdb;$(TargetDir)$(ProjectName).deps.json"
      DestinationFolder="C:\Users\axeman\AppData\Local\MyApp\UserTiles\Dev" />

    <Message Text="Copied build files" Importance="High" />
  </Target>

In part of the path:

... Users\axeman ....

,can I make the axeman as some generic user?

CodePudding user response:

What you're looking for is $(LocalAppData) to get you to the c:\users\{someUser}\AppData\Local

  • Related