Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues when .sln is located in subdirectory #431

Open
roimvsao opened this issue Oct 5, 2021 · 2 comments
Open

Issues when .sln is located in subdirectory #431

roimvsao opened this issue Oct 5, 2021 · 2 comments

Comments

@roimvsao
Copy link

roimvsao commented Oct 5, 2021

VisualStudio extension is not behaving as expected when solution .sln file is not located in a parent folder with respect to project files *.csproj:

  • in Main window, resources names in left panel list are composed only with resx file name instead of path to resx (e.g. myname instead of Model\test\myname)
  • when making a snapshot, if two resources are named the same but are in different folder, only the first resource is evaluated.

To reproduce, create solution composed as following:
/root/a/mysolution.sln
including:
/root/b/project1.csproj
/root//b/project2.csproj

The sln will contain code similar to:
Project("{3F2504E0-4F89-11D3-9A0C-0305E82C3301}) = "Project1", "..\Project1.csproj", "{3F2504E0-4F89-11D3-9A0C-0305E82C3301}"
where the important part is the ..\ going to parent folder.

When running ResXManager in Standalone application and specifying root directory in Browse dialog, everything works as expected. Is there any way to achieve the same when working with Visualstudio extension? e.g. explicitly setting to work in root folder.

To be more specific, I guess that the issue is with ProjectFile.GetRelativePath failing to resolve relative path between solution and project and thus creating a UniqueProjectName which isn't actually unique. Being this assumption not true creates issues next.

@tom-englert
Copy link
Collaborator

Do you have an idea how this could be solved?

@roimvsao
Copy link
Author

roimvsao commented Oct 6, 2021

  1. Find the first common parent folder between .sln folder and .resx folders and use this as root to composeUniqueProjectName.
    con: can potentially create long path when projects are scattered through the disk. But this is potentially a problem also now if resx are located in deep subdirs.
  2. Give the possibility to explicitly set working directory as it is already done in StandAlone application. Selected path can be saved in configuration, relative to .sln file location.
    con: difficult to mantain, user must remember to update this setting when moving sln file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants