I would like to add some scripting support to a Silverlight 4 application that I'm working on. I have the latest stable releases of both IronRuby and IronPython installed on my machine with Visual Studio 2010. I looked at some samples of using the ScriptEngine class with both IronRuby and IronPython. I even got it to work in a small Windows Forms app to make sure my code works. However, I can't seem to Add Reference for the required Assemblies/DLLs to my Silverlight 4 application.
Here's my ScriptEngine code:
ScriptEngine engine = Ruby.CreateEngine();
engine.Runtime.Globals.SetVariable("MainPage", this);
string code = "MainPage.txtTitle.Text = \"Hello from IronRuby!\"";
engine.Execute(code);
And, here's my using statements that it requires:
using IronRuby;
using Microsoft.Scripting.Hosting;
When I try to Add Reference to the following Assemblies/DLLs from the IronRuby 1.0 release, Visual Studio 2010 doesn't let me add them and provides no exception message as to why. As a result I am unable to compile the solution.
IronRuby.dll
IronRuby.Libraries.dll
IronRuby.Libraries.YAML.dll
Microsoft.Dynamic.dll
Microsoft.Scripting.Debugging.dll
Microsoft.Scripting.dll
I assume that the reason Visual Studio 2010 isn't letting me add the Assemblies/DLLs is because they are compiled for .NET and not Silverlight.
Does anyone know where I can get Silverlight 4 versions of those assemblies or exactly what I'm doing incorrectly?
Any help would be appreciated. Thanks!
The Silverlight versions for both IronRuby 1.0 and IronPython 1.0 are hidden in the IronRuby 1.0 for .NET 2.0 SP1 (Zip archive) downloadable from http://ironruby.codeplex.com/releases. In the zip look for silverlight\bin.
The IronRuby 1.1 Silverlight release is also available. IronPython 1.1 for Silverlight however is nowhere to be found. The DLR isn't getting the love from Microsoft it deserves, little documentation, binaries are very hard to find, the future for IronRuby and IronPython doesn't look bright...
Just a note to Koen's answer:
The IronPython\Silverlight\bin .dlls from IronPython 2.6.x are .NET 3.5 binaries (work fine in Silverlight 4). The .NET 4 binaries for Silverlight 4 will be available with IronPython 2.7 (currently in alpha).
I was looking for some kind of scripting engine compatible with Silverlight, and after hours of research, I've found one. I had not tested yet but I just discovered a project called PaxScript.net that has support for Silverlight 3/4/5. According to the author, you can script using VB.NET, C# and Delphi.NET. It does generate byte-code. I don't know why this project is not known, maybe lack of "disclosure".
Related
I have downloaded and installed the new .NET framework 5.0 from this website.
But I would like to know how to add this framework to a project created on Visual Studio 2019 16.8.0.
Note:
I have launched VS installer and I have searched for the new framework, but I can't find it.
I have already opened: Project -> Properties -> Target Framework.
But the most recent framework that I got is .NET framework 4.8
How can I add the new framework to the target frameworks in Visual Studio 2019?
Update:
I have a conflict now and I would like to know what's the difference between .NET framework SDK and .NET framework Developer pack, I'm wrong in this point.
As mentioned in the link above, there is no .NET framework 5.0 in the developer pack list.
Can anyone explain this to me?
Download and install the Visual Studio 2019 SDK from the .NET Core releases site.
.NET 5.0 is continued development of .NET Core and it no longer follows the old (.NET 4 and older) targeting pack. Instead, .NET 5 is installed as an SDK into the .NET Core framework & sdk directory structure. For folks who have been doing .NET Core for some time, this feels natural, but coming from .NET 4, it's new.
Create a new .NET Core project type and set the .NET version to .NET 5.0:
There are specific .NET (not .NET Framework) project templates for Winforms and a few other project types. These will also target .NET 5 or .NET Core where appropriate:
Unfortunately, there is no magic wizard to upgrade a .NET 4 project over to .NET 5. The step-by-step guidance can be found here:
Winforms Migration from .NET 4 to .NET 5
WPF Migration from .NET 4 to .NET 5
Many ASP.NET folks have gone through these steps to move from .NET 4 to .NET Core in the past. There are many blog posts on the issues they bumped into and how they solved that. The process is very similar and there are some tools now to help you along the way.
The main steps are the same for every .NET 4 project:
Change your packages.config to <packageReference> format.
Change your project file to the new SDK project format.
Run the API Compatibility analyzers. This will tell you where to expect breaking changes.
Switch the target framework to .NET 5 in the project file
Update/change/add required nuget packages to the versions that support .NET Core/.NET 5.
Fix any build issues.
Alternatively:
Create a new .NET 5 project of the desired target type.
Add the required project configurations etc.
Add the NuGet Packages you're going to need.
Copy the sources over from your .NET 4 project. Or copy the project file into the folder where your existing project resides. It should automatically import all source files.
Fix build issues
It may be possible there won't be a NuGet package of 3rd party components you use that are compatible with .NET 5. In that case you'll need to either wait for one to be released or find an alternative. Of course, in case of open source projects, you could help them out by porting the package for them and sending a pull request.
The Migration guidance linked above gives you multiple approaches to achieve each step.
I am trying to integrate IronPython in my Silverlight application but am unable to do so. After downloading the binaries, every time I try to add the dlls as references in my VS2010 solution all I get is an error about them not being compiled for Silverlight. I have even tried downloading the source distribution, but cannot set the various projects making up the solution to build against Silverlight (the only choices I have are different versions of the .net framework).
As the IronPython website explicitly states Silverlight compatibility, why is it not working? Is there any easier way of getting scripting capabilities in my Silverlight app?
You have to use binaries from IronPython-2.6.1\Silverlight\bin folder in Silverlight.
I have some code which is in Silverlight 3. I am unable to move to SL4 at this time.
I would however like to use VS 2010 to do my SL 3 development... and SL4 development.
The idea of both runtimes coexisting on 1 machine i thought I heard Microsoft got
right this time in VS 2010.
is this correct?
if yes, then Where can I find the instructions how to set this up?
thanks for any help you can provide,
Sincerely,
J
Silverlight is not side-by-side. VS 2010 provides multi-targeting support for the full .NET framework, which is side-by-side, but NOT Silverlight.
There can only be one version of the Silverlight plugin and runtime on the machine.
That said, if you want to build code targeting one or the other, that is possible by checking in the Silverlight versions to your source enlistment. This post is a little outdated but provides an example for doing this for SL2 and SL3.
Has anybody had any luck with the following combination
F# 2.0
Silverlight v3
.NET Framework 4.0
VS 2010
I have been trying all night and I just can't seem to adopt any of the existing smaples out there to run...
My goal is to have a silverlight application 100% backed by F#; the examples that are referenced as working are mostly C# silverlight apps calling F# Libraries. Which in practice should be fine - but I am really trying to impress my girlfriend :)
VS Info (in case it matters):
Microsoft Visual Studio 2010 Version 10.0.30128.1 RC1Rel Microsoft
.NET Framework Version 4.0.30128
RC1Rel
Installed Version: Professional
Microsoft Visual F# 2010
01018-315-4422943-70575 Microsoft Visual F# 2010
This game is entirely F# + SIlverlight (no C#), has Xaml, etc.
Have you seen this post by Luke Hoban? Looks like the templates he created are a little out of date but it might be possible to hack them to work with VS 2010 RTM.
I have an application, which I develop in VS 2008 and I target .NET 3.
Unfortunately when I install on a clean computer with .NET 3, it crashes. And besides the usual TypeInitilisationError, I have no clue why.
Updating the same machine to .NET 3.5SP1 makes it run fine.
Is there something broken in VS2008 that prevents from telling me a more detailed error?
How can I be sure I don't use any of the newest classes of the framework?
It is true that I found myself using DropShadowEffect which belongs to 3SP1. I removed it.
But still...it does not work.
What am I doing wrong?
Have you tried to determine which version of the framework is installed on each computer. If you're using .Net 3.5 SP1 to compile the program it actually includes .Net 3.0 sp2 which has some extra features (MultiSelector class to name one) which are not available in .Net 3.0 sp1 which is the default install with .Net 3.0 download from Microsoft.
You can try here for some software that will help:
NetVersionCheck
EDIT:
Visual Studio won't tell you about any errors for this because everything seems fine with the version of .Net 3.0 that it's using. I ran into this problem using the WPF toolkit as it requires the MultiSelector class which didn't arrive until .Net 3.0 sp2. So, Jonathan, if you can show us the error output from your program on the 'Fresh' .Net 3.0 computer then we could probably tell you what you're using that is in .Net 3.0 sp2 that isn't supported in lower versions.
Also, I usually use VS2005 with programs that I want to run under a lower runtime than .Net 3.5sp1, but this really only applies to .Net 2.0 apps.
If we knew what components from .Net 3.0 that you're using, it would help as well!
Noah
Thanks for the answer.
Because of VS2008, on my dev computer i have the latest 3.5SP1.
But in Visual Studio i selected 3 as a target.
And to check i install on a clean computer with 3.0...
So your proposition do tells me which framework is installed, but does not tell me what in my program uses in the newest framework that is not present in 3.0.
Moreover, something must be broken in VS2008 as it should warm me for that...
I feel like this is a problem with VS 2008, but obviously MS feels differently.
VS 2008 comes with .NET 3.5, some .NET 3.0 service pack, and .NET 2.0 SP1. It can only detect whether you are using things that don't belong to a version that is installed on your machine, not whether you are conforming to some service pack. This means that if you target .NET 2.0, but install your software on a machine that does not have .NET 2.0 SP1, if you use anything specific to SP1 your application will fail when it tries to make the call.
The only way to detect this that I have seen is to inspect the changelist of the service packs or to target .NET 3.5. If .NET 3.5 is installed, so are the service packs that come with it. It's not a good solution, but it's the only one I've found.