Does Prism 4 support Silverlight 5 Beta?

Topics: Prism v4 - Silverlight 4, Prism v4 - WPF 4
Apr 18, 2011 at 9:12 PM

I would like to upgrade our project to use the Silverlight 5 beta that was released last week at MIX11, but we rely on Prism 4. Will the current drop of Prism 4 work with Silverlight 5 Beta?

Thanks

Apr 19, 2011 at 4:54 PM

Haven't looked at the changes for SL5 and it being a beta, I would wager that there hasn't been any changes to the PRISM code yet for SL5, therefore being uncharted territory.

Developer
Apr 20, 2011 at 5:30 PM

Hi,

Prism v4 is built and targeted at Silverlight 4; therefore it’s not tested with Silverlight 5 beta.

The team is investigating whether there are any compatibility issues when using Prism 4 with Silverlight 5 beta. We’ll let you know when there is more information about this.

Thanks,

Guido Leandro Maliandi
http://blogs.southworks.net/gmaliandi

Apr 20, 2011 at 6:16 PM

Thanks Guido. We're excited to move to the SL5 Beta so we'll be anxiously awaiting some more details.

Sep 1, 2011 at 6:57 PM

Now that the Silverlight 5 Release Candidate is out, is there any news on when Prism will support SL5? For projects with dependencies on Prism, upgrading the app to SL5 is a challenge.

Thanks

Developer
Sep 2, 2011 at 7:10 PM
Edited Sep 2, 2011 at 7:12 PM

Hi,

We have smoke tested the Prism assets (QuickStarts, Reference Implementations, and Prism Library) with Silverlight 5 Beta, and found no major problems.

Therefore, it would be helpful if you could explain us the problems you have encountered when using Prism with Silverlight 5 RC, that make you consider it a challenge, so that we can help you troubleshoot them.

We will soon smoke test the assets again with the Silverlight 5 RC to make sure they work appropriately.

Thanks,

Guido Leandro Maliandi
http://blogs.southworks.net/gmaliandi

Sep 2, 2011 at 7:15 PM

Hi Guido,

That's great to know. I haven't encountered any specific issues yet as we were waiting for word from the Prism team that Prism 4 supported SL5 before we invested the time to migrate the code base.

I'll certainly let the team know if I find any problems.

Thanks for the quick response!

Richard

Developer
Sep 5, 2011 at 6:06 PM
Edited Sep 5, 2011 at 6:15 PM

Richard,

We've smoke tested the Prism assets against Silverlight 5 Release Candidate and found that they seem to work properly.

Thanks,

Guido Leandro Maliandi
http://blogs.southworks.net/gmaliandi

Sep 10, 2011 at 10:48 AM

Hi,

I use a InteractionRequestTrigger in Silverlight 5 RC, In the code   :

  <i:Interaction.Triggers>  

       <prism:InteractionRequestTrigger  

           SourceObject="{Binding ConfirmInsertLineInteractionRequest}">

              <prism:PopupChildWindowAction                 ContentTemplate="{StaticResource flipIt}" /> 

        </prism:InteractionRequestTrigger>  

  </i:Interaction.Triggers>

Visual Studio Said :

Error 3 System.TypeLoadException was thrown on "....ListLineView.xaml":

 GenericArguments[0], 'System.Windows.FrameworkElement', on 'System.Windows.Interactivity.TriggerAction`1[T]'

violates the constraint of type parameter 'T'.\Views\ListLineView.xaml....

 

Expression Blend 5 preview said :

"The type'InteractionRequestTrigger' from assembly 'Microsoft.Practice.Prism.Interactivity' is built an older version of the Blend SDK, and is not supported in a Silverlight 5 project."

 

Thanks for the response!

Alexandre.



        
    
Developer
Sep 12, 2011 at 6:51 PM

Hi,

You could try updating the references (Microsoft.Expressions.Interactions and System.Windows.Interactivity) in the Prism.Interactivity project from the Prism library with the ones provided in Microsoft Expression Blend Preview for Silverlight 5. Then you will have to change your Prism Library's projects build options to Silverlight 5.

Note that you might also have to update other references, such as System.Windows.Controls.

We prepared a basic sample with InteractionRequestTrigger built in Silverlight 5 RC following the aforementioned steps, which could serve as a guide, to compare your solution with it, to find the possible differences that could be causing this problem.

You can find this sample in my skydrive account, under the InteractionRequestTriggerSl5Sample name.

I hope you find this helpful.

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

Sep 12, 2011 at 8:11 PM
Thanks,
very useful and clever,
see you
Nov 20, 2012 at 12:16 PM

Hi,

I've updated these references and that works. However, since I prefer to use Nuget packages I would like to ask to update the Nuget packages for prism to include refs to Microsoft Expression Blend Preview for Silverlight 5. Since the Nuget packages for Prism do support Silverlight 5, i think it makes perfect sense to include the proper expression blend SDK references.

Could this be done?

Kind regards,

Merijn

Developer
Nov 20, 2012 at 4:13 PM

Hi Merijin,

I recently installed the Prism (4.1.0.0 core libraries) Nuget package in a Silverlight 5 application and all the proper binaries were added to my selected projects, including Microsoft.Expressions.Interactions and System.Windows.Interactivity version 5.0.5.0. Were you referencing to these assemblies?

Regards,

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

Nov 20, 2012 at 9:26 PM

Hi Agustin,

Thanks for your reply.

I created a fresh and clean Silverlight 5 project and installed the nuget packages for prism.In this project the problem does not seem to exist.

However, for my main project, the following happened. I re-installed the prism nuget packages and did a full rebuild. Now the message about the older blend SDK disappeared. After executing the same steps again the error message suddenly returned. I verified that the xaml namespaces and referenced assemblies are the same as in my test project.

Sometimes I do not get the Blend SDK message but instead the following two errors:

Error    17    A value of type 'SynchronizeSelectedItems' cannot be added to a collection or dictionary of type 'BehaviorCollection'.   

Error    18    Unable to cast object of type 'SynchronizeSelectedItems' to type 'System.Windows.Interactivity.Behavior'.

These errors relate to the class 'SynchronizeSelectedItems' that I copied from one of the Prism demos distributed with the Prism source code.

BTW. My program runs just fine. So it seems primarily the designer of VS2012 who is complaining.

Any suggestions for how to fix this?

Thanks in advance,

Merijn

Developer
Nov 21, 2012 at 5:08 PM

Hi Merijin,

I tried to reproduce the errors you mentioned, by installing the Prism 4.1 Nuget Package in the MVVM QuickStart provided with Prism in Visual Studio 2012, as this sample uses the custom behavior mentioned above, so far the only way I could reach to similar errors like the one you mentioned was when installing the Nuget package while having the Visual Studio designer open. On the other hand, in my case these errors were gone after restarting my solution. As an alternative, perhaps you could also try cleaning your solution by removing the bin and obj folders in your projects and also the solution user files (.sue , .user files) before rebuilding it with the new installed assemblies.

Best Regards,

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

Nov 23, 2012 at 8:34 AM

Hi Agustin,

Thanks a lot for taking the time to try to reproduce my issue. I've followed your suggestions (deleting bin+obj was something I already tried before, but removing .suo, .user was new.). Unfortunately is doesn't help. Sometimes the errors disappear but then return after a while. Sometimes the errors do not disappear at all. Right now, the error does shows up in one project in my solution and not in another project in the same  solution. After restarting VS, the error appears in both projects. This is the unable to cast error BTW.

Then I restarted VS, performed a solution-wide clean, followed by a solution-wide rebuild all. When I open the xaml designer I now get the error that SynchronizeSelectedItems is built with an older version of the Blend SDK... I'm getting confused...

Do you have any additional tips? Could it be that there are some SL4 settings in my project files that make the designer think I'm using an old SDK?

Thanks again for your help!

Best regards

Merijn

Developer
Nov 23, 2012 at 5:20 PM

Hi,

So far, we still are unable to reproduce the behavior you are mentioning. As an alternative, I believe you could also try opening the .csproj file of your projects to verify that the ItemGroup section where the references are defined, are targeting the correct version and path of the required assemblies (this can be done by opening the file with any text editor).

On the other hand, if this doesn't help, perhaps you could isolate this behavior in a repro sample application that we could check, so that we can help you further with this. Also, it would be helpful to know which version of Visual Studio 2012 you are currently using.

Regards,

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

Nov 26, 2012 at 8:38 AM

Hi Agustin,

Thanks again for your help.

I examined the csproj files and found some suspicious references and also the tag <ExpressionBlendVersion>5.0.30709.0</ExpressionBlendVersion> (what is this used for?). Unfortunately, after cleaning everyting (also bin/obj/.user/.suo files) I do get the same errors.

I'll now try to assemble a minimal solution where I can reproduce the problem. I expect that this will take a while. I'll let you know as soon as Im finished.

Kind regards,

Merijn