Games For Windows Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Tuesday, 23 July 2013

Specifying an Assembly's Location with MEF

Posted on 08:00 by Unknown
Today I came across a problem with dynamically loading assemblies using MEF, when the assembly being loaded has a dependency on yet another assembly. In my case this was SignalR.

Assembly Host (.exe) -> Assembly (.dll) -> SignalR (.dll)

I was typically seeing the error:
Could not load file or assembly 'AssemblyNameHere, PublicKeyToken=xxxxxxxxxxxxxxxxx' or one of its dependencies. The system cannot find the file specified.

The reason for this is because the CLR is looking for the dependency in the directory in which the assembly host is running, and not the location of the assembly MEF loaded in.

The way around this is in this MSDN article. By using the probing tag in the app.config, you can specify the directory to look for dependencies. The caveat with using probing is you can only specify sub-directories of the assembly host, so if you want to use an absolute path to another place on the disk then probing isn't the solution, but I'd argue whether you needed it in another place anyway.

The config change required should look something like this:

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="Modules\"/>
    </assemblyBinding>
  </runtime>
</configuration>
Read More
Posted in | No comments

Dragging a ListView control in a fullscreen WPF touch app causes the whole window to shift

Posted on 05:24 by Unknown
I recently had a bug with the ListView control in WPF where I had a ContentControl using a ScrollViewer with the ItemsPresenter inside of it. When using touch, and navigating through the items, the whole window would shift when you reach the end of the list, which then allowed the user to access the underlying Windows shell.

The cause of this is due to a potential bug in the ScrollViewer control, where the UIElement.ManipulationBoundaryFeedback event is fired, and is not handled by the ListView. As this is a routed event, it continues up the chain and eventually reaches the Window control, which then handles the event and results in an animation of the entire window.

MSDN states:
The ManipulationBoundaryFeedback event enables applications or components to provide visual feedback when an object hits a boundary. For example, the Window class handles the ManipulationBoundaryFeedback event to cause the window to slightly move when its edge is encountered.

The fix (or hack) for this, is to hook in to the event and handle the event, so that it does not bubble up to the Window control.
Read More
Posted in | No comments
Newer Posts Older Posts Home
View mobile version
Subscribe to: Posts (Atom)

Popular Posts

  • Apple starts shipping new iPod touch, iPod nano
    W hen Apple  revealed  the new fifth-generation iPod Touch and the seventh-generation iPod nano at the widely-covered event in San Francisco...
  • Apple Will Announce iPhone 5 On September 12th Event
    Apple is known to be extremely secretive about upcoming product launches. We all know that the company takes the wraps off one flagship ha...
  • IFA 2012: HTC Announces Desire X Android 4.0 Budget Mobile Phone With 4" Screen
    After garnering some not-so-great reviews on its flagship handset the  One X ,  HTC  seems to be pinning its hopes on its mid-range Android ...
  • Best free iPhone apps of all time
    What are the best free iPhone apps worth downloading right now? Although there are a lot of great free iPhone apps to choose from, time is m...
  • IFA 2012: 10 best gadgets on display
                                                                                                                                                ...
  • Download: nexGTv Watch free live TV on your smartphone.
    View the full image nexGTv is a video streaming app that offers live TV on the move. Unlike other apps though, this one actually works, and ...
  • Download: my airtel app (Android, BlackBerry, Java, Symbian)
    After a few consumer complaints that went against Bharti airtel , the brand will score a few barfi points with its subscribers as it has l...
  • Sony Rolls Out Android 4.0 Upgrade For Xperia go, U, sola, And Tablet S
    Sony  has just given its users something to smile about. Ever since the  Xperia U ,  sola ,  and  go  were released , owners had been stuck ...
  • Review: Hitman: Sniper Challenge (PS3)
      Pros: Super addictive; Sniping is satisfying; Unlockable abilities; Requires good strategy to achieve high scores. Cons: Occasionally dumb...
  • F1 2012 – FULL – UNLOCKED – MULTI8
    F 1 2012 is set to deliver the most accessible and immersive FORMULA ONE game for fans of all abilities. In F1 2012 players will feel the un...

Categories

  • .net
  • a
  • aakash
  • acer
  • agility
  • anchor free hotspot sheild app
  • andoid
  • android
  • android buyers
  • android update on samsung galaxy tab
  • apple
  • apps
  • asus
  • blackberry
  • blog
  • buy best android
  • c#
  • cpp
  • dell
  • developer
  • facebook
  • galaxy s3 explodes
  • gaming
  • get android
  • google
  • google android 4.1
  • google news
  • googletab
  • hathway
  • hcl
  • hp
  • htc
  • html
  • htmlagilitypack
  • huawei
  • iball
  • indian isp block
  • intex
  • ios apps
  • ios london 2012
  • iphone
  • iphone 5
  • jokes
  • junior
  • karbonn
  • lenovo
  • lg
  • linq
  • london 2012 mobile game
  • maps
  • mercury
  • micromax
  • microsoft
  • microsoft news
  • microsoft smartphone
  • motorola
  • new android 4.1
  • new apple iphone 5
  • new microsoft phone
  • new windows phone
  • news
  • nokia
  • nokia 808 pureview
  • nokia vs samsung
  • pack
  • programming
  • samsung
  • samsung galaxy s3
  • samsung galaxy s3 vs nokia 808
  • samsung galaxy tab
  • shopping
  • sony
  • sony xperia s ics update
  • sonygame
  • spice
  • swiftkey 3
  • swiftkey keyboard for android
  • tablets
  • torrent blocked sites
  • Tricks And Other Info
  • tumblr for ios
  • unblock torrent sites
  • upcoming android
  • videocon
  • windows
  • windows 7.8 update
  • windows phone 8
  • wishtel
  • wp 7.8
  • xbox
  • xperia s update
  • yahoo

Blog Archive

  • ▼  2013 (45)
    • ►  August (2)
    • ▼  July (2)
      • Specifying an Assembly's Location with MEF
      • Dragging a ListView control in a fullscreen WPF to...
    • ►  June (1)
    • ►  May (7)
    • ►  April (1)
    • ►  March (15)
    • ►  February (14)
    • ►  January (3)
  • ►  2012 (462)
    • ►  November (2)
    • ►  October (124)
    • ►  September (93)
    • ►  August (60)
    • ►  July (106)
    • ►  June (77)
Powered by Blogger.

About Me

Unknown
View my complete profile