No symbols have been loaded for this document

Topics: Prism v4 - WPF 4
Jun 13, 2012 at 6:53 PM

I am using David Veenaman's "Creating View-Switching Applications with Prism 4" from The Code Project.  I have added a third module, ModuleC.  The solution builds and runs properly but the button for ModuleC does not show in the Task Button Region.  During the build, ModuleC is copied to the Module directory so I assume that it is discovered during runtime.  I added a breakpoint in the MoculeC class, but got the following message: "The breakpoint will not currently be hit.  No symbols have been loaded for this documnet".  If I set a similar breakpoint in ModuleA, the breakpoint is hit.

I have read about other projects on the internet that have gotten this same error message, and the solutions to the problem could include copying the C# solution to another folder and other onerous remedies.  I am hoping that my particular circumstance might be more related to something I failed to do in regards to Prism4.

Developer
Jun 13, 2012 at 8:22 PM

Hi,

Based on my understanding, the problem you are describing seems to be related to solution / configuration in Visual Studio rather that to Prism.

In my experience, every time I encounter this kind of error I could solve it by cleaning the solution and deleting all the bin and obj folders of the application and class libraries.

Again, as this is doesn't seem to be related to Prism but to the solution / configuration in Visual Studio, I believe you could might find better support regarding this in the Visual Studio forums:

Regards,

Damian Cherubini
http://blogs.southworks.net/dcherubini

Jun 13, 2012 at 8:52 PM

Thank you, Damian.

Jun 14, 2012 at 2:29 PM
Edited Jun 14, 2012 at 2:31 PM

So I cleaned the solution and deleted all the bin and obj folders of the application and class libraries, but the problem persists.  This makes me believe that the problem lies in my implementation of a third module in the application.  The build puts the dll into the Module folder, but apparently, the new module is not populated in the module catalog.  Is there a way to list the contents of the catalog after it is populated?

Jun 14, 2012 at 2:30 PM

So I cleaned the solution and deleted all the bin and obj folders of the application and class libraries, but the problem persists. This makes me believe that the problem lies in my implementation of a third module in the application. The build puts the dll into the Module folder, but apparently, the new module is not populated in the module catalog. Is there a way to list the contents of the catalog after it is populated?

Developer
Jun 14, 2012 at 5:43 PM
Edited Jun 14, 2012 at 6:00 PM

Hi,

Based on my understanding you could obtain this information from the ModuleCatalog instance which keep track of what modules are available to the application, which modules may need to be downloaded, and where the modules reside.

For example you could retrieve this instance from the container, through its mapped interface, like this:

ServiceLocator.Current.GetInstance<IModuleCatalog>();

Also, I believe you could benefit from the use of the LoadModuleCompleted event provided with the ModuleManager,which will allow you to track when a module loads or fails to load.

You could find more information about this in the following section of the Prism documentation:

On the other hand, if you want to debug a module that is dynamically discovered, as far as I know you should have to use a post build events in your module's project to automatically store the modules' assemblies in the desired folder after a successful build. To see the post-build events configuration, right-click a module project, and then click Properties. In the Properties dialog box, click the Build Events tab.

An example of this could be like the ones used for ModuleA and ModuleB in the aforementioned sample:

xcopy /y "$(TargetPath)" "$(SolutionDir)Prism4Demo\$(OutDir)Modules\"
xcopy /y "$(TargetDir)FsTaskButton.dll" "$(SolutionDir)Prism4Demo\$(OutDir)"

Another example can be seen in the ones used in the Modularity Quickstart provided with Prism.

I hope you find this helpful,

Agustin Adami
http://blogs.southworks.net/aadami