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

Native Nuget - Visual Studio / MsBuild integration is broken #184

Closed
mediantt opened this issue Sep 30, 2021 · 1 comment · Fixed by #186
Closed

Native Nuget - Visual Studio / MsBuild integration is broken #184

mediantt opened this issue Sep 30, 2021 · 1 comment · Fixed by #186
Assignees
Labels

Comments

@mediantt
Copy link

mediantt commented Sep 30, 2021

Adding the Nuget to a project implies it can be easily referenced in the code, such as:
#include <krabs.hpp>

This works well for other Nugets, such as AWSSDKCPP-Core, but it doesn't work here, and one is forced to explicitly specify path to the package folder (in either #include or the project file) - which is quite cumbersome and requires constant maintenance (as it includes the actual revision number):
#include "../packages/Microsoft.O365.Security.Krabsetw.2.0.2/lib/native/include/krabs.hpp"

MsBuild integration is taken care of with krabsetw.targets file, that is meant to be automatically added to the project file - which is what's broken here, I suppose, due to the following:
Within the \build folder, you can provide a “.props” file and/or a “.targets” file that will be automatically imported into the project. For this convention, the file name must match your package id with either a “.props” or “.targets” extension. For example, the ‘cpprestsdk‘ package includes a ‘cpprestsdk.targets’ file in its \build folder.

image

I suppose for this integration to work, krabsetw.targets file must match the package name, i.e. be renamed to Microsoft.O365.Security.Krabsetw.targets

@swannman
Copy link
Member

swannman commented Oct 8, 2021

Nice find @mediantt! I've created #186 which should resolve this in nuget version 4.2.2.

swannman added a commit that referenced this issue Oct 8, 2021
* Rename targets file to match nuget id per #184

* Add assert_valid_assignment specialization that was missed in #148

* Bump nuget versions

* Revert unneeded change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants