Created
May 14, 2011 07:27
-
-
Save mhoyer/972015 to your computer and use it in GitHub Desktop.
Silverlight to "classic" .NET assembly converter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET ILDASM=C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\ildasm.exe | |
SET ILASM=C:\Windows\Microsoft.NET\Framework\v4.0.30319\ilasm.exe | |
mkdir $(TargetDir).net | |
"%ILDASM%" "$(TargetPath)" /out:"$(TargetDir)$(TargetName).il" | |
sed -i "s/7C EC 85 D7 BE A7 79 8E/B7 7A 5C 56 19 34 E0 89/" "$(TargetDir)$(TargetName).il" | |
sed -i "s/ \.ver 2:0:5:0/ .ver 2:0:0:0/" "$(TargetDir)$(TargetName).il" | |
del "$(TargetDir)sed??????" | |
"%ILASM%" "$(TargetDir)$(TargetName).il" /dll /resource:"$(TargetDir)$(TargetName).res" /out:"$(TargetDir).net\$(TargetName).dll" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
By now there is no real testing framework for Silverlight available. After reading this nice article from David Betz, one can think of simply converting plain Silverlight POCO class libraries to classic .NET libraries and run the converted ones against common testing frameworks.
Requirementes
sed
(known from ?nix) is required to replace assembly bindings in IL code. Simply download binaries.zip and dependencies.zip from http://bit.ly/4thAhR and move the .exe and .dll files to a location in%PATH%
environment where Visual Studio will find it.Usage
Simply use upper gist in a Visual Studio project for a Silverlight class library as post-build event script.