How to edit the Full Path property of the file in Visual Studio

Asked

Viewed 132 times

0

I added an existing file to my project. With this, it fixes the Full Path of my file, and I can no longer change.

What I need to do is edit this value by using variables such as $(SolutionDir), so that the Compile project independent of the directory in which it was downloaded.

Example of the case:

I did include. The Full Path is as follows: C:\Users\Victor\Desktop\Contribs\roundto\src\roundto.c

When in fact I would need him to be available at: $(SolutionDir)\..\..\src\roundto.c

Here is the step by step I use to add the files:

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

  • Have you tried removing the file and adding what is within the project structure?

  • 1

    @jbueno, if I do this, it will take the current directory of the file on my machine. If someone downloads my project, they’ll have to adjust according to his machine.

  • He won’t, young man. If you do the Include in Solution it will include normal.

  • Honestly, it doesn’t even make much sense. Do you have a real case that this occurs or are you guessing? The property FullPath is the concatenation project site with the file relative path

  • @jbueno, I edited the question by quoting an example

  • Ah, it’s a C project. There may be some difference. In the other files the FullPath is this second way?

  • @jbueno, it always gets the first one. The problem with this is that as the guys pull, they will have to delete and include the files again.

  • How bizarre this behavior. You can make a GIF showing how to add the files?

  • @jbueno, edited again, with process images

  • Instead of doing this, do the following: move the file (by the filesystem itself) to the desired folder within the solution, then click the "show all files" icon (it is above the explorer Solution) then go to the folder and you will see the file faded, click on it with the direct button and click on "Include in project".

  • @jbueno, Let’s go continue this discussion in chat.

Show 6 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.