Can't find Prism Libraries

Aug 30, 2012 at 8:59 AM
Edited Aug 30, 2012 at 9:00 AM

Suddenly the Prism libraries are lost, I can't add reference to them.

The Add Reference Dialog, with Component Names sorted is:

As you can see, there's no trace of the Prism Libraries.

I don't know what happended, the projects that are developed with Prism still work, but I still can't see them in the Add Reference Dialog. If I removed them from the solution, I couldn't add them back.

I ran RegisterBinaries.bat (Prism 4.1), but the problem still persists. I'm using Silverlight 5.

Aug 30, 2012 at 6:22 PM

Hi Rafael,

You can try registering the Prism v4.1 library assemblies again by running the RegisterBinaries.bat file; however, take into account that Prism v4.1 comes with a known issue where the libraries are registered in the Add Reference dialog targeting Silvelight 4 instead of Silverlight 5. You can find more information about this known issue in the following work item:

I believe this issue could be the reason why your problem is not resolved after running the RegisterBinaries.bat file. Based on my understanding, after fixing the RegisterPrismLibrary.proj file like described in the aforementioned work item, you should be able to register the Prism library again without problems.


Damian Cherubini

Aug 31, 2012 at 3:36 AM

Hi Damian:

The changes didn't solve the problem. Here's the new RegisterPrismLibrary.proj:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="RegisterLibrary" xmlns="">
    <RegistrationKey>Prism v4</RegistrationKey>
    <_BinFolder Condition=" '$(_BinFolder)' == '' ">..\Bin</_BinFolder>
    <_EscapedFullBinFolder>$(_FullBinFolder.Replace('\', '\\'))</_EscapedFullBinFolder>

  <ItemGroup Condition="'$(Register)' == 'true'">
    <RegistrationLine Include="Windows Registry Editor Version 5.00"/>
    <RegistrationLine Include="[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\$(RegistrationKey)]"/>
    <RegistrationLine Include="$(_DestopBinFolder)"/>
    <RegistrationLine Include="[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Silverlight\v4.0\AssemblyFoldersEx\$(RegistrationKey)]"/>
    <RegistrationLine Include="$(_SilverlightBinFolder)"/>
    <RegistrationLine Include="[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Silverlight for Phone\v4.0\AssemblyFoldersEx\$(RegistrationKey)]"/>
    <RegistrationLine Include="$(_PhoneBinFolder)"/>

  <ItemGroup Condition="'$(Register)' != 'true'">
    <RegistrationLine Include="Windows Registry Editor Version 5.00"/>
    <RegistrationLine Include="[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\$(RegistrationKey)]"/>
    <RegistrationLine Include="[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Silverlight\v5.0\AssemblyFoldersEx\$(RegistrationKey)]"/>
    <RegistrationLine Include="[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Silverlight for Phone\v4.0\AssemblyFoldersEx\$(RegistrationKey)]"/>

  <Target Name="RegisterLibrary">
    <WriteLinesToFile File="$(_TempRegistrationFile)" Lines="@(RegistrationLine)"/>
    <Exec Command='regedit.exe /s "$(_TempRegistrationFile)"'/>
    <Delete Files="$(_TempRegistrationFile)"/>

In your article you write: "<RegistrationLine Include="[HKEY_LOCAL_MACHINE...", but the rest of the lines have

"<RegistrationLine Include="[-HKEY_LOCAL_MACHINE", there's a hyphen in the other lines before the HKEY_LOCAL... definition, I tried with this hyphen and without it, but the problem persisted.

I remember having this problem in the past, and you sugested the same, I just forgot it, but this problem reappeared because I had to format my disk and reinstall everything, at that time, the problem was solved, but this time it is not working, I don't know why!

Aug 31, 2012 at 3:41 AM

The probem was solved, I didn't realize that there are two lines to be modified, watching at what I previously I wrote I saw it. I made the remaining change and voilá!.

Thank you Damian.