error trying to test, please help

Dec 10, 2011 at 11:51 AM

Error 1 Unknown build error, 'Cannot resolve dependency to assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event. Line 10 Position 55.'  C:\Users\Groboto\AppData\Local\Temporary Projects\TEST\MainWindow.xaml 10 55 TEST

<Window x:Class="TEST.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Physics="clr-namespace:XamlPhysics;assembly=XamlPhysics"

        Title="MainWindow" Height="350" Width="525">
  
        <Canvas Background="#FF980000" Width="1024" Height="768">
            <Physics:PhysicalBox x:Name="PhysicalBox">
                <Physics:PhysicalBox.Clock>
                    <Physics:GameLoop />
                </Physics:PhysicalBox.Clock>
                <Rectangle Canvas.Top="100" Canvas.Left="0" Width="400" Height="30" Fill="Black">
                    <Physics:PhysicalBox.Body>
                        <Physics:RectangleBody IsStatic="True" />
                    </Physics:PhysicalBox.Body>
                </Rectangle>
                <Rectangle Canvas.Top="0" Canvas.Left="20" Width="10" Height="10" Fill="Black">
                    <Physics:PhysicalBox.Body>
                        <Physics:RectangleBody Mass="10" />
                    </Physics:PhysicalBox.Body>
                </Rectangle>
            </Physics:PhysicalBox>
        </Canvas>
</Window>

Pleae can tellme what im doing wrong and correct my code if needed?
THK!


Coordinator
Dec 11, 2011 at 8:35 PM

The code you posted here looks fine, there is nothing wrong with it.

What kind of project is this? And what version of .Net are you using? XamlPhysics runs in .Net 4 or Silverlight 3 and up.

Dec 11, 2011 at 9:25 PM
Edited Dec 11, 2011 at 10:22 PM

wpf c# project,  net 4.0, visual studio 2010, under windows 8
Really be good if somebody can upload some working c# examples with source code.

I cant make this work!  ; (

Coordinator
Dec 11, 2011 at 10:25 PM

Ok, that code doesn't look right if that is from a wpf project. If looks like you are trying to use the Silverlight dll.

Make sure you are referencing XamlPhysics.WPF.dll and not XamlPhysics.dll. They are built with the same code but they aren't interchangeable.

Also this line

xmlns:Physics="clr-namespace:XamlPhysics;assembly=XamlPhysics"

Will have to change to this

 

xmlns:Physics="clr-namespace:XamlPhysics.WPF;assembly=XamlPhysics.WPF"

 

Dec 11, 2011 at 11:10 PM
Edited Dec 11, 2011 at 11:32 PM

I already try that and not work
If i change the licne to xmlns:Physics="clr-namespace:XamlPhysics.WPF;assembly=XamlPhysics.WPF"

Just not work and error now is:


Error 1 The tag 'PhysicalBox' does not exist in XML namespace 'clr-namespace:XamlPhysics.WPF;assembly=XamlPhysics.WPF'. Line 9 Position 10. C:\Users\Groboto\AppData\Local\Temporary Projects\WpfApplication1\MainWindow.xaml 9 10 WpfApplication1


Error 2 Assembly 'XamlPhysics.WPF' was not found. Verify that you are not missing an assembly reference. Also, verify that your project and all referenced assemblies have been built. C:\Users\Groboto\AppData\Local\Temporary Projects\WpfApplication1\MainWindow.xaml 4 19 WpfApplication1


Error 3 The type 'Physics:PhysicalBox' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\Groboto\AppData\Local\Temporary Projects\WpfApplication1\MainWindow.xaml 9 10 WpfApplication1


Error 4 The attachable property 'Clock' was not found in type 'PhysicalBox'. C:\Users\Grobot\AppData\Local\Temporary Projects\WpfApplication1\MainWindow.xaml 10 14 WpfApplication1


List of error continue...............

xmlns:Physics="clr-namespace:XamlPhysics.WPF;assembly=XamlPhysics.WPF"      not work  ; (


 i already have correctly referenced the dlls
 what is the problem?




Dec 12, 2011 at 10:36 PM

Please really need some help with this !

Coordinator
Dec 12, 2011 at 10:49 PM

What you're telling me isn't adding up. Can you make your project available for download so I can see exactly what's happening?

Dec 13, 2011 at 12:20 AM

http://www.4shared.com/file/8Ow4_71W/pHISICS.html

Hoppe can detect what is the problem.

Dec 14, 2011 at 9:23 AM

Sorry for insist but have some idea what originate the problem?

Coordinator
Dec 15, 2011 at 5:23 AM

I got a chance to sit down and try this out.

Your project was trying to use the Silverlight dll instead of the WPF one. I change it to reference a copy of XamlPhysics.WPF.dll instead of XamlPhysics.dll and it immediately started working.

Then I added this to the load event and it started moving.

PhysicalBox.Clock.Start();

That's all that was wrong.

Dec 15, 2011 at 10:06 AM
Edited Dec 15, 2011 at 11:00 AM

 

Yes, thankyou!!

I downloaded the binaries files, and not see have to use WPF binaries instead the first download file available on the page.

Now I found 2 new problems i open new post for that.