Docproject External UI problem

Topics: Bugs, General Discussion, General Questions
Apr 15, 2008 at 3:32 PM

I found a another problem in teh External UI while I was tryign to re-create the previous problem I reported. The External UI does not recognize $(SolutionDir) it does however recognize $(TargetDir) . The post build step in on one of the other project that I reference in my documentation project.

I have a post build step in my project that uses xcopy to copy some files around it does the following:

xcopy $(SolutionDir)/DevEnv/Common/. $(TargetDir) /Y

This works fine in visual studio but when I open my documentation project in the External UI and try to build the help I get the following error.

xcopy undefined/DevEnv/Common/. "D:\DevEnv\Project\Bin" /Y

So you see the $(TargetDir) translates properly but the $(SolutionDir) does not.


Apr 15, 2008 at 7:05 PM
Hi Joe,

Interesting issue. I guess Visual Studio is responsible for defining SolutionDir since MSBuild doesn't work with solutions.

Maybe if the External UI were to define SolutionDir as a program environment variable it would work. I'll give it a shot and get back to you.

Apr 15, 2008 at 8:06 PM
Hi Joe,

Creating a SolutionDir environment variable with process scope didn't help. However, explicitly assigning the value of SolutionDir as a configuration property after the MSBuild project is loaded in the External UI did work:

project = new MSBuildDocProject(msEngine, projectFile);
project.ConfigurationProperties["SolutionDir"] = @"C:\the solution dir";
I'll have to figure out a way for you to tell the External UI which solution to use, unless it can discover it automatically. I'm leaning toward injecting a dynamic project property that you can set like any of the other properties.

This feature will also be used to support managed C++ projects as DocProject sources when using the External UI since C++ projects require a solution file to build. (This has its own work item already).

I can't say for sure whether I'll be able to get this feature in the next release, but I'll consider it. For now, the only work-around that I can think of is to create a custom build engine provider (inherit from the Sandcastle provider if you'd like) and assign the SolutionDir configuration property using a DocProjectEnvironment.ProjectOpened event handler. You can subscribe to the ProjectOpened event in an override of the provider class's Load method.

- Dave
Apr 15, 2008 at 8:09 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.