Silverlight Video Demo Applications Issues

Silverlight Video Demo Applications Issues

Old forum URL: forums.lhotka.net/forums/t/9196.aspx


nhwilly posted on Saturday, July 10, 2010

Well guys, it looks like I'm caught between all the version nonsense.

I extracted the projects and tried to build them.  I updated the path to the cslight 3.8.3 CSLA.DLL so the reference would be correct (after trying v4).

I eventually got that working and the code compiling, but now I get this error:

"An error occurred while trying to make a request to URI 'http://localhost:25053/WebService.asmx'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details."

I checked the service config and it looks OK (as far as I can tell).

This has to be some configuration issue on my system (Win7 64bit ), but I can't figure it out.

Should I tried to update the demo code to SL v4, CSLA v4 and .NET v4?

I know there are some breaking changes (corrected the ones I found) but I'd like to get moving on the project.

Any help would be great.

 

RockfordLhotka replied on Sunday, July 11, 2010

That error is a cross domain security error - a pretty standard Silverlight issue due to a Silverlight feature.

The answer is to make sure the web app is the startup project in the solution.

Right now your Silverlight app is the startup app, but the Silverlight app makes a service call to the web app. That means you have two web servers running, each is a different virtual root, hence a cross domain call occurs.

nhwilly replied on Sunday, July 11, 2010

Thanks, Rocky.

I actually started out that way, then ran into the v3.8 vs v4.0 breaking changes with business rules and somehow in all the mad clicking that followed, for some unknown reason, set it back to the SL project.  I eventuallyl referenced the correct v3.8 csla.dll and got it close to working and then forgot about setting it back to the web project.

I was trying to get the environment right enough to compile the app before I went through that segment of the video.  Bad idea.  Naturally the next 60 seconds gave me the instructions I needed to avoid all this.

Working great now, thanks.

nhwilly replied on Tuesday, July 13, 2010

There seems to be a difference between the demo code and what is displayed in the video, and it looks like it makes a difference in how the Save and Cancel buttons work.  They are actually not enabled/disabled depending on the status of the object.   Since I am XAML challenged I didn't see how to fix it easily.

Demo code:

      <StackPanel Orientation="Horizontal" DataContext="{Binding Source={StaticResource data}}">
        <Button Content="Save"
                Margin="5"
                csla:InvokeMethod.TriggerEvent="Click"
                csla:InvokeMethod.MethodName="Save" />
        <Button Content="Cancel"
                Margin="5"
                csla:InvokeMethod.TriggerEvent="Click"
                csla:InvokeMethod.MethodName="Cancel" />
      </StackPanel>

Video code:

      <StackPanel Orientation="Horizontal">
        <Button Content="Save"
                Margin="5"
                csla:InvokeMethod.TriggerEvent="Click"
                csla:InvokeMethod.Resource="{StaticResource data}"
                csla:InvokeMethod.MethodName="Save" />
        <Button Content="Cancel"
                Margin="5"
                csla:InvokeMethod.TriggerEvent="Click"
                csla:InvokeMethod.Resource="{StaticResource data}"
                csla:InvokeMethod.TriggerEvent="Click"
                csla:InvokeMethod.MethodName="Cancel" />
      </StackPanel>

I am using 3.8.3 for Silverlight if that affects this.  I don't see that csla.InvokeMethod contains a "Resource" property (at least it doesn't come up in Intellisense).

TIA

RockfordLhotka replied on Tuesday, July 13, 2010

The videos were created for 3.6. I provided updated code for 3.7.

There are some changes in 3.8 that affect the way some of the controls and components work. You'll need to read the 3.8 change logs to see how the changes affect the demos and you.

Copyright (c) Marimer LLC