-
Notifications
You must be signed in to change notification settings - Fork 180
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
[Vcxproj] Improve NuGet handling in packages.config mode & add necessary logic for package reference mode #399
base: main
Are you sure you want to change the base?
Conversation
We want VS to find files in build/native/ piror to files in build/
2. Add searching priority for reference files
…yle includes for C++ project. (requires extra Directory.Build.props hack)
Hi The next step is we need some samples using this if you ever want this to land eventually. Thanks. |
It looks like you need to update some samples reference files(see CI failure) |
Hi, Run Yet the doc about what needs to be done in order to add a new sample is fairly unclear to me. There is a Samples.md but it is not enough, many other things are not mentioned like how to properly make reference files, how to update launchSettings.json, etc. Currently the new sample involves a copy action of P.S. there is one thing needs to be beware of: in SamplesDef.json the target of |
you need to edit UpdateSamplesOutput.bat and run it. this will generate new references files. |
the changes looks fine but the CI fails possibly due to the fact that you need to regenerate references(execute updatesamplesoutput.bat after edit) |
1. Improve
.targets
import logic when using NuGet packages.config modeOld Behaviour:
/build/native/*.targets
and/build/*.targets
are both imported.Problem: in common,
/build/native/*.targets
for C++ project is firstly chosen if presented, old logic will make/build/*.targets
also be imported, and in before of/build/native/*.targets
, causing troubles.e.g. Microsoft.WindowsAppSDK
Current Behaviour:
/build/native/*.targets
import is made before/build/*.targets
, it will check if/build/native/*.targets
is not presented, then do the
/build/*.targets
import.2. Add support codes for NuGet package reference mode in
.vcxproj
The current NuGet support for C++ project is incomplete.
.props
file import is not supported..targets
and.props
files are initially presented in order to generate correct error check..targets
and.props
files are not supported.[Vcxproj] Support explicit path to NuGet .targets, and clean up existing packages.config if no longer needed #390
here and NuGet/NuGet.Client#3145 have shown the way to force package reference mode for
.vcxproj
.To achieve this in Sharpmake, it requires
Directory.Build.props
<PackageReference>
element generation support inside SharpmakeThis PR contains the 2. part.
I haven't figure out the best way to automatically handle 1., but since
Directory.Build.props
is originally a thing that users manually add to their projects, so it should be no harm to let them also add that custom configuration manually (for now?)P.S. the default NuGet mode for C++ project still keeps as packages.config.