asp.net - Instantiate a Silverlight control in an HTTP Handler,...Possible? -


i have http handler in asp.net project , wanted produce image based upon silverlight user control rendered out bitmap.

however, in processrequest, when try instantiate xaml control, following exception....

{"the type initializer 'ms.internal.jolthelper' threw exception."}

... following stacktrace ...

at ms.internal.jolthelper.get_threadid() @ ms.internal.xcpimports.checkthread()
@ system.windows.dependencyobject..ctor(uint32 nativetypeindex, intptr constructdo)
@ system.windows.controls.usercontrol..ctor() @ casecard..ctor() in c:!working_folder\trunk\proactive\proactive.ui\casecard.xaml.vb:line 6 @ servicelocator.getcard() in c:!working_folder\trunk\proactive\proactive.ui\servicelocator.vb:line 20 @ proactive.host.imagegeneratorhandler.processrequest(httpcontext context) in c:!working_folder\trunk\proactive\proactive.host\app_code\imagegeneratorhandler.cs:line 10 @ system.web.httpapplication.callhandlerexecutionstep.system.web.httpapplication.iexecutionstep.execute() @ system.web.httpapplication.executestep(iexecutionstep step, boolean& completedsynchronously)

... , inner exception ...

{"could not load file or assembly 'system.xml, version=2.0.5.0, culture=neutral, publickeytoken=7cec85d7bea7798e' or 1 of dependencies. system cannot find file specified.":"system.xml, version=2.0.5.0, culture=neutral, publickeytoken=7cec85d7bea7798e"}

now,..i inherited project couple of months ago , it's 'in awful condition. i'm battling on track there real issues somewhere it's entirely possible environmentally amiss.

that said, i'm starting wonder if possible since silverlight runs on totally different framework. have go gdi+ done?

any , appreciated.

the reason doesn't work because asp code running in context of full .net framework , while trying instantiate silverligt control - exception says - assembly system.xml version 2.0.5.0 not loadable/found.

note version: 2.0.5.0. of silverlight core dlls have version instead of 'normal' .net version 2.0.0.0.

this no accident - silverlight runs inside context of small clr subset of regular clr. it's not same clr, though of identical , while c# source code same, runtime isn't identical.

at moment, can't mix silverlight code full .net based code asp.net.

there work being done inside microsoft on extracting common core of regular .net , silverlight (a couple of libraries actually) better sharing, that's not yet publically available.

also note if source code of 1 of silverlight 4.0 libraries not use silverlight specific code, able load regular .net process, reverse not possible (silverlight being subset, not other way around).

all aside, might achieve goal by:

  1. running silverlight app oob on server , communicating asp.net pages via ipc mechanism
  2. recompiling code wpf , load that; when recompile, mean adapt/refactor since silverlight ui not pure subset of wpf

neither particularity easy, though i'd lean towards second option it's cleaner.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -