开发者

CodeDom and Silverlight

开发者 https://www.devze.com 2023-01-20 21:26 出处:网络
Can Silverlight apps (the .xap file, the testpage.html, content resources along side a ClientBin, out of browser settings, etc) be created using only System.CodeDom from a regular .NET app? Meaning I

Can Silverlight apps (the .xap file, the testpage.html, content resources along side a ClientBin, out of browser settings, etc) be created using only System.CodeDom from a regular .NET app? Meaning I have a console or winforms app that creates Silverlight apps - is this possible with System.Codedom?

I have searched 开发者_运维知识库high and low and haven't found any information on this.


Although this will be a challenge, it should probably be possible. If you look at what the framework itself does, there are a few options though.

  • For example, the Regex class uses System.Reflection.Emit to compile your regulare expressions;

  • XmlSerializer uses System.CodeDom to generate assemblies for serializing and deserializing XML;

  • ASP.Net calls the C# compiler (csc.exe) to compile ASPX pages (and all other parts of the ASP.Net application) into an assembly.

These are all options to create a valid assembly, ordered from very complex, to relatively doable.

And concerning your Silverlight part of the question. This should simply be a case of creating a valid project. Probably the easiest way to go is to create the simplest Silverlight project you can think of (so, without any content) and try to emulate that with one of the three options. If you've got that running, than gradually add parts until you've got what you need.

0

精彩评论

暂无评论...
验证码 换一张
取 消