Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

455
Vistas
$(TargetDir) replacement for SDK-style projects (analogue to "$(MSBuildProjectDirectory)\" for "$(ProjectDir)")

I have an old project in non-SDK-style format generated by Visual Studio. It contains a post-build event in which $(ProjectDir) and $(TargetDir) are used.

I am currently transforming the project into a new SDK-style project (csproj file). If I just turn that post build event into a Target Exec Command, I get errors. After prefixing the command with echo I could see why: The values $(ProjectDir) and $(TargetDir) were both empty.

I figured out that replacing $(ProjectDir) by $(MSBuildProjectDirectory)\ gives the desired result, but what is the equivalent for $(TargetDir)?


Note that I am not using Visual Studio for the new SDK-style project. I am using Visual Studio Code. It seems that Visual Studio sets values for $(ProjectDir)/$(TargetDir)/others, but Visual Studio Code does not. I build my project using dotnet build.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Seems I found the answer here:

The value of TargetDir is computed as the full absolute path of whatever you specify as the Output Path for your project, which is stored in the OutputPath property directly in your project file (.CSPROJ, .VBPROJ, etc.).

So I believe $(TargetDir)would be $(MSBuildProjectDirectory)\$(OutputPath).

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda