Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everybody!

First of all, it's not a big deal, I can solve the problem by manual editing of config files, but I'm curious why this is happening. So if you don't really want to read my whole novel, don't waste your time :) .

I have a solution currently containing 2 C# projects and 1 written in C++/CLI. All projects are targeted for 4.5 .NET version and I'm using Visual Studio Express 2012 for Windows Desktop.
I have a little problem with the C++/CLI project, that is a wrapper project for an image processing library, that uses OpenCV. I have set up the library dependencies for OpenCV using Property Sheets both for Release and Debug configuration.

When I created the first property sheet, everything was OK. The second property sheet was created partially. No matter what I did in Visual Studio, it didn't save the Additional Dependencies property. I had to manually edit the .props file and restart Visual Studio.

The third property sheet wasn't even saved. Well, at least the .props file was created with some basic contents, but none of my settings were saved.

In each case I clicked Add New Project Property Sheet in the Property Manager. It doesn't seem I have done something special between each sheet creation, just compiling the solution. I don't see errors in Visual Studio when I click Apply or OK in Property Sheet Properties, however the linker didn't recognize the libraries until I edit the .props file in Notepad.

Now, these are the files and error messages:

Error message from Compiler(which is OK, since the .props file didn't save information about additional include directory):
Error	1	error C1083: Cannot open include file: 'Feature.h': No such file or directory	C:\Users\...\Documents\Visual Studio 2012\Projects\Solution1\Project3\Image.cpp	8	1	Project3



I don't know if it helps, but these I my current .props files:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Label="PropertySheets" />
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup>
    <LibraryPath>C:\opencv\build\x86\vc11\lib;$(LibraryPath)</LibraryPath>
  </PropertyGroup>
  <ItemDefinitionGroup>
    <ClCompile>
      <AdditionalIncludeDirectories>C:\opencv\build\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    </ClCompile>
    <Link>
      <AdditionalLibraryDirectories>C:\opencv\build\x86\vc11\bin;C:\opencv\build\x86\vc11\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
      <AdditionalDependencies>opencv_calib3d2410d.lib;opencv_contrib2410d.lib;opencv_core2410d.lib;opencv_features2d2410d.lib;opencv_flann2410d.lib;opencv_gpu2410d.lib;opencv_highgui2410d.lib;opencv_imgproc2410d.lib;opencv_legacy2410d.lib;opencv_ml2410d.lib;opencv_nonfree2410d.lib;opencv_objdetect2410d.lib;opencv_ocl2410d.lib;opencv_photo2410d.lib;opencv_stitching2410d.lib;opencv_superres2410d.lib;opencv_ts2410d.lib;opencv_video2410d.lib;opencv_videostab2410d.lib;%(AdditionalDependencies)</AdditionalDependencies>
    </Link>
    <ProjectReference>
      <UseLibraryDependencyInputs>true</UseLibraryDependencyInputs>
    </ProjectReference>
  </ItemDefinitionGroup>
  <ItemGroup />
</Project>


The third "blank" .props file:
<?xml version="1.0" encoding="utf-8"?> 
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Label="PropertySheets" />
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup />
  <ItemDefinitionGroup />
  <ItemGroup />
</Project>


Answer:

Well the answer is, that the problem was between the chair and computer screen Smile | :) .

After editing the properties for that particular property sheet you must save it by right clicking on it and selecting Save "NameOfPropertySheet"

I fell really dumb. It seems, that the first time I clicked the menuitem or pressed Ctrl+S, but later I forgot about it. To be honest this was the first time I used Visual Studio Property Sheets and somehow I supposed, that clicking on OK saves them.

Anyway, all that matters everything working like it should.
Posted
Updated 26-Dec-17 1:43am
v2

1 solution

Same funny thing happened to me also :-). I actually used "Save All" button on toolbar to save the property sheet but did not work.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900