I think I’ve found a bug with the solution
task. I’m not sure this is the proper forum, but here goes anyway. It appears references to managed c++ libraries are
removed for solution tasks that have the outputdir parameter set. Here is the setup:
To get the error:
I believe I’ve tracked down the cause. When the c++ project is built, the output is sent to
the designated outputdir. Then when the console project is built it tries
to resolve the path to the c++ library in its original location instead of the
outputdir location. I’ve made the following change to the
ProjectReferenceBase.cs GetAssemblyReferences method. Notice that the projectOutputFile
variable has been updated to point to the OutputDir.
public override StringCollection GetAssemblyReferences(string solutionConfiguration) {
StringCollection assemblyReferences = null;
// check if parent is a VB.NET
project
if (typeof(VBProject).IsAssignableFrom(Parent.GetType())) {
assemblyReferences = Project.GetAssemblyReferences(solutionConfiguration);
} else {
assemblyReferences = new StringCollection();
} ConfigurationBase projectConfig = (ConfigurationBase) Project.GetConfiguration(solutionConfiguration); string outFile = projectConfig.BuildPath; string projectOutputFile = FileUtils.CombinePaths(projectConfig.OutputDir.FullName, Path.GetFileName(outFile));
// check if project has output file
if (projectOutputFile != null) {
if (File.Exists(projectOutputFile)) {
// add primary output to list of
reference assemblies
assemblyReferences.Add(projectOutputFile);
}
}
// return assembly references
return assemblyReferences; } Thanks, |