Problem using variables and relative paths in Visual studio 2019 (publish profile)

331 Views Asked by At

I have imported an old Visual studio 2015 application to Visual studio 2019. I converted everything so it works, execpt one thing. I can't get relative path or environment variables to work in publish profile. In DesktopBuildPackageLocation i have ..\..\..\Deploy\project.zip and it won't work. For some unknown reason the only variable that I gotten to works is MSBuildThisFileDirectory. So I have tried to replace it with $(MSBuildThisFileDirectory)..\..\..\..\..\Deploy\project.zip But that still doesnt work, the error I gets is ...

Severity    Code    Description Project File    Line    Suppression State
Error       Web deployment task failed. (The path '<pathline>\Properties\PublishProfiles\..\..\..\..\..\Deploy\OAS.Parameters.xml' is not valid.)   OAS     0   

and the diagnostic log gives

2021-01-11 21:01:59
System.AggregateException: One or more errors occurred. ---> Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.
   --- End of inner exception stack trace ---
---> (Inner Exception #0) Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.<---

Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.

===================

If the use a hardcoded path(shrugg) it works but it creates a mess with the deployscript and creates an indirect requirement that that path is carved in stone and cannot be changed. I have tried with variables BaseOutputPath and BaseIntermediateOutputPath and they seems to be empty. Any solutions, suggestions and/or ideas?

0

There are 0 best solutions below