Reputation: 1
we are working on a market simulation program using C++ and we would like to keep track of the changeset when that simulation is run, as the program is changing over time. We need to store the changeset value to a text file that contains the simulation results. I'm working with some students on it at a community college. We found the library that has the functions that we need, "Microsoft.TeamFoundation.VersionControl.Client.dll" and its location in the file system, but we can't reference this library to use the function we need. Visual Studio doesn't give us the option to reference this library. We also tried some NuGet packages that contain this class, but they didn't install because NuGet package didn't "not contain any assembly references or content files that are compatible with that framework".
"Attempting to resolve dependency 'Machado.Microsoft.TeamFoundation (≥ 12.0.0.0)'.
Installing 'Machado.Microsoft.TeamFoundation 12.0.0.0'.
Successfully installed 'Machado.Microsoft.TeamFoundation 12.0.0.0'.
Installing 'Machado.Microsoft.TeamFoundation.Client 12.0.0.5-beta5'.
Successfully installed 'Machado.Microsoft.TeamFoundation.Client 12.0.0.5-beta5'.
Adding 'Machado.Microsoft.TeamFoundation 12.0.0.0' to FOR_REAL_THIS_TIME_GUYZ.
Uninstalling 'Machado.Microsoft.TeamFoundation 12.0.0.0'.
Successfully uninstalled 'Machado.Microsoft.TeamFoundation 12.0.0.0'.
Install failed. Rolling back...
Could not install package 'Machado.Microsoft.TeamFoundation 12.0.0.0'. You are trying to install this package into a project that targets 'Native,Version=v0.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author."
Any help would be appreciated.
Upvotes: 0
Views: 113
Reputation: 49331
Your program will want to know the version of the source it was built from, not the current version, so it shouldn't be trying to access source control at run-time.
As part of your build process, add a pre-build event which executes a program that writes the changeset number to a file. Depending on your source control, there may already be a command line tool which does this, or you may need to create one with a small C# program and the library you are trying to reference.
Upvotes: 1