What I want to do is be able to compile C# source to a GC'able assembly 
that I can also save and load later.  According to Microsoft, the 
collectible assemblies generated by Rosalyn are not saveable.  See  
http://social.msdn.microsoft.com/Forums/en-US/dlr/thread/13403a6c-5e73-43d6-9a9a-1a7c2b5626c4
 . 
 MSDN also states that I cannot load a discardable assembly in the standard 
way, but it seems that if I know what I'm doing with Cecil and 
Reflection.Emit well enough, I could accomplish this.  Thus, I want to 
serialize a collectible assembly and be able to deserialize it.  I have not 
yet attempted to do anything of this - before doing so, I wanted to learn 
if there were any hidden pitfalls or gotchas that will make this more 
complicated or render it impossible.

In my application, I have a large number of formulas that are used to 
convert raw sensor values to recognized units (for example, degrees 
celsius).  These formulas must be evaluated at high speed, thus compilation 
to native code.  There's a bunch of other implementation details that are 
irrelevant to the scope of this question.


On Wednesday, June 27, 2012 7:00:17 PM UTC-4, fir3pho3nixx wrote:
>
> Pretty general question man. Need more specifics. Creating "Serializable" 
> assemblies out of non-serializable assemblies is pretty trivial but you are 
> perhaps better off just compiling them out to be serializable in the first 
> place(or else rewrite the assembly using CIL). As for the dynamic type 
> generation, loading and unloading. Are you really asking whether Cecil can 
> do dynamic types and read/write 4.5 framework assemblies? The answer is 
> yes. As for the unitized values bit I am lost ... completely ... 
>
> On 27 June 2012 23:13, Dlux wrote:
>
>> Good day (or night) fine developers.  I am considering using Cecil to 
>> create an assembly cloner and loader.  This was take assemblies generated 
>> by Rosalyn (NET 4.5), clone them to a serializeable assembly that I could 
>> then save, and then later reconstruct a CollectibleAssembly from the 
>> serialized version.  This would be used on file close in an application 
>> that uses a great many expressions to convert raw values into unitized 
>> values.  I'd save the compiled version as a part of the "document", sign 
>> it, then on load, if the signature vets, I don't have to recompile them.
>>
>> From looking at Cecil I think I could do this, but I haven't done 
>> anything this low-level with assemblies before.  Does anyone else have any 
>> relevant experience or knowledge on roadblocks or problems I may encounter 
>> [attempting to] do this?
>>
>> David L-
>>
>> -- 
>> --
>> mono-cecil
>
>
>

-- 
--
mono-cecil

Reply via email to