This forum has been archived. Please start a new discussion on GitHub.

Visual Studio plug-in woes

I'm trying to work through the Filesystem sample in the manual. So, I created a VS solution (VS 2008) with three projects:

Book.Filesystem (solution)
__Ice (project, contains .ice files and slice2cpp generated files)
Client (project for client)
Server (project for server)

In the Client and Server projects, I added the existing generated Filesystem.h and Filesystem.cpp (generated from the __Ice project), just so I would have only one copy of, Filesystem.h, and Filesystem.cpp throughout the Solution.

Now when I right-click on the __Ice project and select Ice Configuration, when I click on most of the various checkboxes, the dialog exits immediately with no changes saved. This seemd to have worked until I had an actual .ice file in the __Ice project.

So, reading the web page regarding the VS plug-in, it said that sometimes you might have to disable and re-enable the plugin. Having done that, I now no longer have an "Ice Configuration" choice when right-clicking the __Ice project, and now changes to the .ice file do not cause the .h/.cpp files to be regenerated.

After restarting Visual Studio, I'm back to the first situation where any attempt to interact with the Ice Configuration dialog causes it to just close immediately.

The reason I wanted to change the settings for the __Ice project was to add the --impl complier option for slice2cpp (which I just read about in the manual).

For now, I just planning on setting this up manually (via custom build step, etc.).

Is the organization of my solution/projects fundamentally wrong or something?




  • xdm
    xdm La Coruña, Spain
    Hi Mike,

    I don't see any reason why this shouldn't work.

    could you upload a solution example that reproduce the problem?
  • Sure; thanks for taking a look.

  • dwayne
    dwayne St. John's, Newfoundland
    Could you also let us know what version of Windows you are using.
  • Sure, using XP SP2.
  • Just trying to figure this out...

    I added a breakpoint in the source in IceCppConfigurationDialog.cs:

    private void chkIceUtil_CheckedChanged(object sender, EventArgs e)
    componentChanged("IceUtil", chkIceUtil.Checked);

    This causes componentChanged to be called. On line 565 (after my edit, I guess line 564 before that), Util.addIceCppLibs is called.

    I think I traced at least one issue to line 1296 in Util.cs (see below). In line 1301, compilerTool.PreprocessorDefinitions is called, but before this in line 1296, compilerTool is NULL after the assignment on this line (and also on line 1298 linkerTool is also null after this assignment).

    This apparently causes the statement on line 1301 to crash, except no exception is thrown that I can see, and the instruction pointer just returns to the call Util.addIceCppLibs noted above.

    1292 foreach(VCConfiguration conf in configurations)
    1293 {
    1294 if(conf != null)
    1295 {
    1296 VCCLCompilerTool compilerTool =
    1297 (VCCLCompilerTool)
    1298 VCLinkerTool linkerTool = (VCLinkerTool)
    1300 bool debug = false;
    1301 if(!String.IsNullOrEmpty(compilerTool.PreprocessorDefinitions))
  • xdm
    xdm La Coruña, Spain
    Hi Michael,

    Looking at your visual studio solution, i found that __Ice project , has not Linker, C/C++ options, and when the extension try to configure the project it fails because this are not present, we will fix the plug-in to report an error in such case.

    I wonder why there isn't c++ options in your project properties, what kind of visual studio project have you used for __Ice project?

    In any case i think will be easy for you setup to create a "Class Library" project in visual studio and link client and server with that library. In this project you should enable the plug-in and add slice files, in this way the generated files will be compiled only once for both.

    In the way you have setup the project the plug-in will only configure __Ice project and not client and server, so you still will need to configure client and server projects manually to link with Ice libraries and to set include directories.

    In general the plug-in is designed so the generated files are compiled with the project they belong and what you are trying will not work. We will look if this can be improvement, but still think that the class library is a better solution for your use case.

    Thanks for take the time of reporting and investigate this problem.

  • Thanks for the explanation. I changed the project type to "Utility" (Configuration Properties -> General on the Project Properties dialog). I can't remember why I did this; I think it was simply an attempt to prevent compiling of Filesystem.cpp and generation of .obj files, etc.

    I changed the project type to "Static Library (lib)", and now the Ice add-in works perfectly.