conan-io / conan-vs-extension

Conan Extension for Visual Studio
https://marketplace.visualstudio.com/items?itemName=conan-io.conan-vs-extension
MIT License
59 stars 34 forks source link

Missing "Add requirement" button #225

Closed Todiq closed 3 months ago

Todiq commented 3 months ago

Hello!

I am using conan 2.2.0 and VS 17.8.8 LTSC. I just installed the extension v2.0.1, but it looks like there is an issue with the GUI, making it impossible to install any conan package. My conan executable is accessible through a virtualenv. I tried starting VS from both its executable in the Windows' start menu and from a terminal which had the venv activated, but both cases led to the same issue.

We can see that the "Add requirement" button is not present. Could you please have a look? Thank you!

image
czoido commented 3 months ago

Hi @Todiq, the Add requirement button should appear right after clicking OK in the window on the right and after you select one of the libraries of the list on the left. Could you please try?

Todiq commented 3 months ago

Hello @czoido,

Thanks for the quick response. Unfortunately, it still does not do anything

czoido commented 3 months ago

@Todiq, Could you please first click he refresh button (🔄) on the list of the left and after that click on any library of the list and send an screenshot of that?

Todiq commented 3 months ago

@czoido,

Clicking the refresh button gave me the confirmation window (libraries data file updated), but it still does not display anything after selecting any package

image
czoido commented 3 months ago

Hi @Todiq, I tried to reproduce with no luck, I'm using a newer version: 17.9.3, I don't know if maybe that has something to do. Have you tried to restart Visual Studio in case for any reason the plugin initialization when starting VS did something wrong?

danimtb commented 3 months ago

I have tried from my side with the VS 2022 version I have installed (17.8.6) and it worked fine for me. I installed the plugin fresh from the marketplace and the "Add requirement" button appears when I click on one library.

Not sure if this could be an issue of this VS specific version or just an initialization issue of the plugin. Please try restarting visual studio and selecting other conan client path or use the one from the system. Also, although it might be unrelated, try with a different project as well.

Todiq commented 3 months ago

@danimtb,

I think it might come from the conan client. I fully reinstalled VS (Pro edition), now in version 17.9.5, to get the same error. I still have to try installing conan system-wide to check if it fixes the issue

Todiq commented 3 months ago

@danimtb

I tried using conan system wide, switching VS to english and installing the extension through the release page but still cannot get it to work. May it be caused by my CONAN_HOME? It is set to a specific location. Unless it is because I use the Pro edition of VS, but that would not make much sense

czoido commented 3 months ago

Hi @Todiq, I think we finally found the problem. The plugin is only compatible with Visual Studio projects that use msbuild, so it's trying to detect some properties from the vcproj and if there's none it may fail. Is it possible that you are trying to use the plugin from a project that's not C++ or maybe it's a C++ CMake project? Could you please try to use the plugin from a new C++ project created from the Visual Studio template like this?

image

I think that could be the case, and we have to make some kind of detection of the project the plugin is running in to provide users a warning message about this. Please try and ping us back.

Todiq commented 3 months ago

I tried without selecting a project and with my c++ cmake project, but that led to the display issue. It does indeed work properly with the console app template

czoido commented 3 months ago

@Todiq, thanks a lot for reporting this, we have opened a PR to a warning for cases where the extension is not meant to work to help users.