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.

Developer
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.

Regards,

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

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="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Register>true</Register>
    <RegistrationKey>Prism v4</RegistrationKey>
    <_BinFolder>$(BinFolder)</_BinFolder>
    <_BinFolder Condition=" '$(_BinFolder)' == '' ">..\Bin</_BinFolder>
    <_FullBinFolder>$([System.IO.Path]::GetFullPath($(_BinFolder)))</_FullBinFolder>
    <_EscapedFullBinFolder>$(_FullBinFolder.Replace('\', '\\'))</_EscapedFullBinFolder>
    <_DestopBinFolder>@="$(_EscapedFullBinFolder)\\Desktop\\"</_DestopBinFolder>
    <_SilverlightBinFolder>@="$(_EscapedFullBinFolder)\\Silverlight\\"</_SilverlightBinFolder>
    <_PhoneBinFolder>@="$(_EscapedFullBinFolder)\\Phone\\"</_PhoneBinFolder>
    <_TempRegistrationFile>$([System.IO.Path]::GetTempFileName())</_TempRegistrationFile>
  </PropertyGroup>

  <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>

  <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)]"/>
  </ItemGroup>

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

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.