Public include directory not added in referenced project - visual-studio

I have added a path in VS2022 to a C++ project under project property page => public include directories. Let's call it Project A
Project A was added with add Reference as reference to C++ Project B. However, Project B does not recognize the include paths of Project A.
Do I need to set something else?

requires at least Platform Toolset v143
Previously, an older version was used.

Related

Nuget referenced DLL not beeing copied to referencing project

I have two project A,B. Project B has a reference to project A (B -> A). Project A has Thinktecture.IdentityServer.Core package which has dependency on Thintecture.IdentityModel and a simple class which make use of Thinktecture.IdentityServer.Core:
public class Class1
{
public UseThinktecturecoreInOrderToCopyDll()
{
// wrapper for Thinktecture.IdentityModel
Thinktecture.IdentityModel.Web.ProtectionMode wrapper
= Thinktecture.IdentityModel.Web.ProtectionMode.MachineKey;
}
Thinktecture.IdentityServer.Repositories.ICacheRepository repository;
}
Now when I build solution the Thintecture.IdentityModel is copied to project A, but is not copied to project B. But when I update packages then Thintecture.IdentityModel dll on next solution build is copied to project B. Can anyone explain this behavior? How can I force copying without updating packages? why packages update solve the problem?
I have this problem on more complex solution. I know it is possible to solve the problem by building project A separately but I'm not satisfied with that solution as it require to keep building the project A separately.
*Also I do not like a solution where I have to add reference to each project which I'm indirectly using (for Thinktecture.IdentityModel).
You have problem with references in your NuGet packages. Your Thinktecture.IdentityServer.Core has a reference on Thintecture.IdentityModel 3.4.0 and you have installed Thintecture.IdentityModel 3.0.0. So visual studio doesn't copy invalid Thintecture.IdentityModel 3.0.0 reference. When you update your Thintecture.IdentityModel to version 3.4.0 it starts working because reference is valid.

Conflict with VS project dependencies and lib files

I have a big VS2008 solution containing >30 VS projects with legacy code. One of these projects (let's call it A) generates a header file, which is needed by a few other projects (for example B). When I go to "Project Dependencies" of the VS solution, I can check project A for project B's dependencies - but VS includes in the project B's linker command line options an additional argument for project A's lib ("A.lib"). Unfortunately, since project A does not create a lib file, this project B will never find one and cannot be built.
Is there a feasible solution for my problem?
Thanks in advance!
Cheers,
Chris
You should set Ignore Import Library in project A.
This option specifies that the (import) library generated by this configuration should not be imported into the dependent projects.

Visual C++ 2010. How to include header files which reside in another included project

I have 1 project. I imported in this project many external VC++ projects.
I wanna to import in a .c file which resides in one of the included projects a .h (header file) which resides in another included VC++ project.
How can achieve this?
In the properties for the project, add the location of the header files to the
C/C++ | General | Additional Include Directories
item.
To get the library project linked in, add a reference to it in the:
Common Properties | Framework and References
item.
I wish that adding the project reference would get the IDE to automatically add the refered-to project directory to the include file path, but it doesn't.
You should add a path to the other project. It's preferred to use the macros like $(SolutionDir) to refer to other projects in the solution.

VSIX Package doesn't include referenced project's dependencies

We have a visual studio package (VS Package) that references a class library project (Project A). Project A in turn references another class library project (Project B).
So the dependency structure looks like this: VS Package > Project A > Project B
All projects exist inside the same solution and the dependencies have been set up as proper project references.
If I build the package in visual studio and look in the bin/Debug folder all necessary assemblies are there including Project B's. However when the package is deployed, only Project A's assemblies are present and Project B's are missing. How do I tell visual studio to include the indirect dependency of Project B in the package?
This MSDN document suggests that "By default in a multi-project solution, if a project that outputs to a VSIX package includes a reference to another project in the same solution, it includes the dependencies of that project."
However I am finding that this is simply not the case.
My question is very similar to this one except that I am having trouble with the main project assembly and not the localization satellite assemblies. The answer in this other post does not work for me because it seems to only work for satellite assemblies.
Is there some other Output Group that I can specify to direct the package to include indirect dependencies as well?
Thanks for looking.
The simplest thing to do in this particular case is reference Project B from the VSPackage project and set the "Reference Output Assembly" property to False to avoid introducing a compile-time dependency.
I had a similar problem: My VS Package project referenced another VS package project (~Project A) which in turn referenced a bunch of other projects (~Project B) containing the meat of our extension.
Inspired by this answer: VSIX package doesn't include localized resources of referenced assembly, I added 'BuiltProjectOutputGroup;BuiltProjectOutputGroupDependencies;GetCopyToOutputDirectoryItems;SatelliteDllsProjectOutputGroup' to the Output Groups Included in VSIX property of the reference from VS Package to Project A.
This had the effect of dropping all the dependency DLLs in the ...\Debug\ folder for my VS Project, but they still didn't get included in the VSIX.
Finally I went and added the BuiltProjectOutputGroup;BuiltProjectOutputGroupDependencies;GetCopyToOutputDirectoryItems;SatelliteDllsProjectOutputGroup flags to all the references from my Project A to each of my Project Bs - then they all got included in the VSIX.
(BTW this is with with Visual Studio 2013, but it doesn't seem to have change much since 2010)

Visual Studio Project that only references shipped static library and sets include directories

Is it possible to create a Visual Studio project file that just references a shipped static library and sets include directories?
Here is an example of what is shipped:
...\libfoo\lib\libfoo.lib
...\libfoo\include\libfoo\libfoo.h
If I want to use libfoo in another project, for example, 'baz'- I have to manually add the static library reference and add an include directory in the 'baz' project. That's much more work and more fragile than just adding a project reference to libfoo (assuming I had full source and project file for libfoo).
In the end I want to ship one more file:
...\libfoo\libfoo-user.vcxproj
Which when added as a project reference for 'baz' adds the static library to the link line and sets the include path.
Possible with Visual Studio 2010?

Resources