Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Parsing headers inside installed NuGet packages
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

aignatenko
New Member

Russia
3 Posts

Posted - Dec 19 2013 :  04:07:17 AM  Show Profile  Reply with Quote
We are using NuGet with native C++ packages (http://docs.nuget.org/docs/reference/support-for-native-projects). This is quite handy and works relatively stable.

However, VA doesn't look into the headers inside installed packages, while Intellisense does (VS 2012). I guess this is so because include paths for nuget packages are injected into .vcxproj as "import" directives.

Are there any workaround to make VA work with C++ NuGet packages?

Edited by - aignatenko on Dec 19 2013 04:08:21 AM

feline
Whole Tomato Software

United Kingdom
18746 Posts

Posted - Dec 19 2013 :  9:52:14 PM  Show Profile  Reply with Quote
Do you have a sample project I can use to study this problem? I have tried following the steps given on this page:

http://coapp.org/tutorials/installation.html

but something is going wrong, and when I get to the line where you type:

Update-CoAppTools -KillPowershells

into a Powershell window I just get an error about the module could not be loaded. So there is obviously something I am missing.


Do you know the directories you want VA to parse? If you are only working on a few solutions then adding these directories to the project include directories.

Go into the project properties for your solution, and add the required directories to:

Configuration Properties -> VC++ Directories -> Include Directories

I would recommend pressing the button:

VA Options -> Performance -> Rebuild symbol databases

and restarting VS2012 after making this change, and hopefully it will have the desired effect.

zen is the art of being at one with the two'ness
Go to Top of Page

aignatenko
New Member

Russia
3 Posts

Posted - Dec 23 2013 :  06:43:49 AM  Show Profile  Reply with Quote
I've made a very simple project to demostrate the problem:
You can download it here: https://www.dropbox.com/s/wimxtqbhadxutw0/VA_nuget_test.zip

Before using, you need to install NuGet from the VS extension manager.
This project reference zlib library from nuget.org server. It should be downloaded automatically when you try to compile the project. You'll find unpacked zlib in $(SOLUTION_DIR)\\packages.

The project is using v100 runtime, because zlib packages doesn't have prebuild binaries for v110.

Anyway, note that references to zlib.h are not parsed by VA.

quote:
Do you know the directories you want VA to parse? If you are only working on a few solutions then adding these directories to the project include directories.


Yes, I tried this and it seems to work. However, I can't recommend this approach to my team. Maybe as a workaround only.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18746 Posts

Posted - Dec 23 2013 :  8:19:10 PM  Show Profile  Reply with Quote
I have the test project, thank you for this. The solution builds, but I am not sure this is working the same way your situation is working.

At the top of the file "ConsoleApplication1.cpp" I have:

#include <zlib.h>

the #include is underlined with a red line, which is coming from VS2012. Right clicking on "zlib.h" and selecting "Open Document <zlib.h>" (the IDE command) I get an error message from the IDE, telling me that the IDE cannot find "zlib.h" in any of the include directories. Are you seeing the same behaviour, or is this working differently for you?

At least here, what ever method the build process is using to identify the directories is not known to the IDE, so I should not be getting any intellisense here either.

zen is the art of being at one with the two'ness
Go to Top of Page

aignatenko
New Member

Russia
3 Posts

Posted - Dec 24 2013 :  09:13:59 AM  Show Profile  Reply with Quote
It works differently at my side.

#include <zlib.h> is not underlined and I can go to definition (F12) of, e.g. deflateInit which is defined in zlib.h. "Go to file" is working, giving the file from $(SOLUTION_DIR)\\packages\\zlib.1.2.8.6\\build\\native\\include\\zlib.h

VA is disabled for tests.

VS information:

Microsoft Visual Studio Ultimate 2012
Version 11.0.61030.00 Update 4
Microsoft .NET Framework
Version 4.5.50938






Edited by - aignatenko on Dec 24 2013 09:16:28 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18746 Posts

Posted - Dec 30 2013 :  11:32:44 PM  Show Profile  Reply with Quote
Thank you for your patience and clear instructions. I found the problem with the #include <zlib.h> line being underlined, I needed to restart the IDE / reload the solution after getting NuGet to generate the packages, before the directory and file were known to the IDE.

I understand now why adding directories for these packages is not going to scale well, the packages are in solution specific directories. I have put in a bug report for this:

case=79296

Hopefully it won't be to difficult to work out the extra directories to check.

zen is the art of being at one with the two'ness
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Jun 26 2014 :  01:49:09 AM  Show Profile  Reply with Quote
case=79296 is fixed in build 2042.
Go to Top of Page

mikhail.matrosov
Senior Member

Russia
29 Posts

Posted - Jul 11 2014 :  04:16:29 AM  Show Profile  Reply with Quote
The issue is still actual when packages.config is modified not by Visual Studio NuGet Package Manager, but externally, e.g. after switching git branches. Is there any workaround?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18746 Posts

Posted - Jul 14 2014 :  5:18:12 PM  Show Profile  Reply with Quote
If you close and reload the solution, or the entire IDE, is VA then picking up the correct directories? I am assuming you are switching git branches while the solution is open.

zen is the art of being at one with the two'ness
Go to Top of Page

mikhail.matrosov
Senior Member

Russia
29 Posts

Posted - Jan 02 2015 :  03:16:07 AM  Show Profile  Reply with Quote
The issue is still actual. I'm using boost NuGet package (http://www.nuget.org/packages/boost/) in my solution and VAX does not parse it automatically. If I open a boost header manually, VAX sees and remembers all the definitions. But after I restart IDE, they are gone.

VAX settings: https://www.dropbox.com/s/fdbyxy1gjp62m91/20150102115747.reg?dl=0
Visual Studio settings: https://www.dropbox.com/s/23zuk0eoj0kp0yl/Exported-2015-01-02.vssettings?dl=0

VAX info:
VA_X.dll file version 10.9.2052.0 built 2014.11.05
DevEnv.exe version 12.0.31101.0 Ultimate
msenv.dll version 12.0.31101.0
Comctl32.dll version 6.10.7601.17514
Windows 7 6.1 Build 7601 Service Pack 1
8 processors (x86-64, WOW64)
Language info: 1251, 0x419
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jan 11 2015 :  4:58:49 PM  Show Profile  Reply with Quote
I was able to reproduce the problem using boost so I have put in a bug report for this:

case=87289

Thank you for the clean steps.
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Apr 10 2015 :  11:31:02 PM  Show Profile  Reply with Quote
case=87289 is fixed in build 2062.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000