This project has moved and is read-only. For the latest updates, please go here.

CodeBlockComponent: Unable to load source file

Topics: User Forum
May 3, 2011 at 11:56 PM

BUILDASSEMBLER : error : CodeBlockComponent: Unable to load source file 'C:\Users\v-midoda\Documents\SandcastleBuilderGUI\Templates\VS2005.config'. Error: Could not find a part of the path 'C:\Users\v-midoda\Documents\SandcastleBuilderGUI\Templates\VS2005.config'. [C:\Users\v-midoda\Documents\Sandcastle\Help\Working\BuildReferenceTopics.proj]

I'm new to Sandcastle, but the error above leaves only more questions.  Why is it looking there for the config file?  What can I do to fix?  This is the first sample project for which I simply followed intructions in the documentation.

May 4, 2011 at 4:17 PM
Edited May 4, 2011 at 4:21 PM

Sorry about that.  The comments file for the SandcastleBuilder.Components.dll selected in the walkthrough now contains a code element that tries to load a source file from the SHFB templates folder.  I need to update the walkthrough to use a different assembly that doesn't have such a dependency.  For now, here's how to fix it:

  • Select the project's ComponentConfigurations property and click the "..." button to bring up the editor.  If you're using the VS2010 extension, open the project properties and select the Component Configurations tab.
  • Double click the Code Block Component to add it to the project.
  • Select it in the list on the right and click the Configure button.
  • Check the "Allow missing source code files/regions" option to allow missing code elements.
  • Click OK to save the configuration.
  • Click Close to close the component configurations dialog or close the VS2010 project properties window.

When you build it after that, it should work.



May 4, 2011 at 5:00 PM

Thank you very much for getting back and quickly. Now I am trying the project that I actually want to do and I'm getting another error on the last step.  I ran numerous times to find all the dependencies and I think I have them now.  But this error has me completely stumped:

BUILDASSEMBLER : error : CodeBlockComponent: Unable to load source file 'C:\Users\v-midoda\Documents\Sandcastle\ConsoleSimple\Program.cs'. Error: Could not find a part of the path 'C:\Users\v-midoda\Documents\Sandcastle\ConsoleSimple\Program.cs'. [C:\Users\v-midoda\Documents\Sandcastle\Help\Working\BuildReferenceTopics.proj]

May 4, 2011 at 5:50 PM

About the previous errror: the folder ConsoleSimple does not exist in the Sandcastle folder.  The other file, BuildReferenceTopics.proj, is where the error says it is looking.

May 4, 2011 at 7:40 PM

Your suggestion seems to have solved the new problem as well.  Thanks very much!

May 4, 2011 at 8:24 PM

If a <code> element in the XML comments has a source attribute that references a source file from which to import the code, a relative path is resolved based on the project folder being the base folder.  You may need to adjust the relative path so that it finds the file based on the project folder or fully qualify the path so that it isn't an issue.  Turning on the option to ignore the missing code blocks works around the issue but results in a warning in the rendered topic about the missing code.



May 4, 2011 at 8:29 PM

Good to know.  Thanks again.