How to use IronPython with Visual Studio 2008 - visual-studio

I've tried using the IronPython integration extension provided by Microsoft. But it does not work with Visual Studio 2008.
Is there a proper VS 2008 IDE extension for IronPython?

For IronPython 1.1 support (whose syntax mirrors CPython 2.4), I successfully built and installed the sample from the Visual Studio 2008 SDK 1.0 with the Professional Edition of Visual Studio 2008 SP1. It will work with any edition from Standard up to Team Suite. It definitely won't work with Express Edition due to limitations built in to Express.
For IronPython 2.0 (whose syntax mirrors CPython 2.5), there is currently no good way to write and debug under Visual Studio 2008, and unfortunately, it would be a significant undertaking to adapt IronPython Studio to host IronPython 2.0--one of the big updates in IronPython 2.0 was to base it on the Dynamic Language Runtime, and this breaks the tricks for enabling IntelliSense that were used previously such as static compilation.

Have you tried the IronPython Studio for VS 2008 Shell

Right now, there is no extension to run IronPython v2.0 on Visual Studio.

I'm new to both VS2008 and IronPython (but not Python itself): but it sure looks to me like i'm running IronPython 2.0.1 under VS 2008 Pro, albeit in a rather cumbersome fashion.
Follow the instructions at http://blogs.msdn.com/aaronmar/archive/2006/02/16/533273.aspx, with some modifications: search the MS website for the VS 2008 SDK instead, and the path to the IronPythonIntegration solution is therefore in a slightly different (but predicatable) place.
Following on -- "Then, it should simply be a matter of hitting CTRL+F5 for Build & Run. This will launch Visual Studio using the "Experimental hive".". Yes, this launches another VS instance on top of the first one, but thankfully you only have to wait through the build process the first time.
The rest of the instructions worked for me: i built a simple test console app, and it worked as i expected. I haven't tried any .Net stuff yet, though.
Now if there were just an easy way to change sys.path to use the normal Python libraries ...

string code = #"100 * 2 + 4 / 3";
ScriptEngine engine = Python.CreateEngine();
ScriptSource source =
engine.CreateScriptSourceFromString(code, SourceCodeKind.Expression);
int res = source.Execute<int>();
Console.WriteLine(res);
For the complete tutorial and example code, check out the following link:
Extending your C# application with IronPython
http://blogs.microsoft.co.il/blogs/berniea/archive/2008/12/04/extending-your-c-application-with-ironpython.aspx

If you are just looking at using IronPython in ASP .NET websites (projects not supported), check out how to install Microsoft ASP.NET Futures (July 2007)

Related

New Laptop - Any reason to install Visual Studio 2012 AND 2013?

I've just been given a new work laptop and have an MSDN subscription. My old laptop had VS 2008, 2010 and 2012. I'd rather not install all of these again if I can avoid it. My main question here is whether there any reason to install VS 2012 if I have access to VS 2013? I believe Projects & Solutions are compatible, what other reasons might there be for installing VS 2012 (and for that matter VS 2010) again? If I have an MVC 3 app created with VS2010, will it be possible to open and work with that in VS2013 without having to "upgrade" the project type?
It really depends on what kind of projects you are working on. Each new releases of VS in fact remove certain features.
http://msdn.microsoft.com/en-us/library/vstudio/hh266747.aspx
ASP.NET MVC 3 is not supported by VS2013.
Lex' answer is pretty good. I'd also like to add that if you are using C++/CLI, upgrading to Visual Studio 2013 will force you to target .NET 4.5, which might not at all be desirable if your users only have .NET 4.0 etc.
You can still target the older frameworks, by letting VS2013 use the older "Platform Toolset" from e.g. VS2010 or VS2012, but this will force you to have either one of these installed. I am using this exact scenario (VS2010 + VS2013) and it works quite well. (I have only VS2010 and 2013, not 2012 in that specific virtual machine.)
Update: Here is a MSDN page which backs up my statement about C++/CLI, just for the reference.

IDE / language for Okuma machine tool control development

I'm trying to set up some new developers to make apps for the Okuma control using the Okuma API and SDK. What environment should they use? I tried installing Visual Studio Express 2012 but it keeps giving an error looking for files during install. Also, what language should they use so they can work with the Okuma API?
The Okuma API is written using .NET 4.0 so you really have several options.
Normally I'd say Visual Studio express 2012 for desktop is best but I've seen problems putting it on Windows XP.
If you're using windows XP and aren't ready to invest in a full version of Visual Studio yet, I'd recommend Visual C# Express 2010. If you're more familiar with VB and don't want to switch, do the VB express verison.
All these (and the professional version) are available from
www.microsoft.com/visualstudio/eng#downloads
VS 2019 community edition is currently working fine for me doing this. I just have to choose which .net framework in the project settings. That was not listed in the prior answer in case anyone comes across this in the future.

IronPython :- Visual Studio 2010 or SharpDevelop?

I'm considering developing a medium-size project for a client in IronPython. It's a pretty straightforward replacement for an existing system I've been supporting for several years, so the specification is quite well defined and understood.
This is my first significant IronPython and .Net project so I'm expecting a bit of a learning curve. I was going to use SharpeDevelop, but I can purchase VisualStudion 2010 for a reasonable price and whilst I understood that IronPython Tools for Visual Studio 2008 were not so good, I haven't seen anything about the update for 2010 yet.
Has anyone used either or both of these in a reasonable-sized commercial environment and do you have any recommendations?
(and I'm aware of this question, but this is specifically about VS2010)
Here is a quick comparison of IronPython Tools for Visual Studio 2010 and SharpDevelop showing the features that one has which the other does not:
IronPython Tools for Visual Studio 2010 has:
Better intellisense.
WPF designer.
Can edit your code without a project.
Go to definition support.
Find all references support.
More comprehensive IronPython interactive window integration.
SharpDevelop has:
WinForms designer.
Code conversion support from C#, VB.NET to Python
Compiles your IronPython code to an executable or class library.
Both of them are free. You can use IronPython Tools with the Visual Studio 2010 Shell (Integrated) which is a free download.
Considering that the IronPython Tools for VS2010 are "only" at the CTP stage, they're very high quality (anyone else would call them a beta). I've been using them when I can for a while now and haven't had any major issues. If you do have any issues with the VS2010 tools, the IronPython team is very open to feedback.
I haven't used SharpDevelop's tools, however, so I can't really compare them.
Greetings;
From what I've followed and read on-line during the Visual Studio 2010 Beta program and after, there seems to be no direct IDE support for IronPython in Visual Studio .NET 2010:
http://www.itwriting.com/blog/2158-why-f-rather-than-ironpython-in-visual-studio-2010.html
However, there is a Dynamic Language Runtime Support for the .NET 4.0 Framework using IronPython through a stable release of IronPython 2.6.1 on CodePlex:
http://ironpython.codeplex.com/releases/view/36280, but again, there is no direct support for the Visual Studio .NET 2010 IDE.
As for IronPython support in SharpDevelop, the IDE has full support for WinForms and Console based applications, and debugger support for IronPython, including 2.6.1 and the .NET 4.0 Runtime beginning with SharpDevelop 3.2 RTW. Matt Ward, who has headed up the IronPython and SharpDevelop IDE integration efforts has been very active and helpful through the forums and his blog entries. I was working on a small project in IronPython using SharpDevelop, and for the questions and bug that I found during SharpDevelop 3.0 Beta 1, Matt's support and turnaound time for IronPython issues was tremendous.
With this in mind, if you're looking for the productivity gains of using an IDE, with source code debugging support for IronPython applications and all of the benefits of using the .NET 4.0 Framework and DLR Support, you may want to start with SharpDevelop.
I hope this was of help...

If I have Both Visual Studio 2008 and 2010, do have I have to keep both

I recently downloaded VS 2010 trial, the new version is more easy to use.
I have VS 2008 installed, If i decide to use VS 2010 in the future, do I still have to keep VS 2008? Is there any compatibility issue with it?
You would need to keep VS2008 installed if you target Windows CE (via Compact Framework, native smart device projects, etc.)
http://msdn.microsoft.com/en-us/library/sa69he4t.aspx
Also if you want to write native applications that run on versions of Windows before XP SP3 and Server 2003 SP2, this is no longer possible with VC++ 2010. The same applies to managed code written for the .NET Framework 4.0, but you can still use Framework 3.5 with VS2010 for projects with managed code only.
And Intellisense for C++/CLI code is gone (MS promises to remedy that in the future, whether a service pack or the next version I cannot say).
If you open a VS 2008 solution or a project in VS 2010 it will be converted to VS 2010 and you will not be able to open it in VS 2008.
If that is not a problem then you don´t have to keep VS 2008, unless you are using a addin or some other third party application with VS 2008 that is not compatible with VS 2010.
Edit:
Look at Ben Voigt´s answer for information for which version have support for different platforms.
VS2010 allows you to specify the target framework that you'd like to develop on. There should be no reason to keep VS2008 installed unless you've become accustom to some handy plugins :)

Can I use Visual Studio 2010 without breaking my 2008 apps?

Now Visual Studio 2010 is out can I use Visual Studio 2010 without breaking my 2008 apps? Can I still compile to .Net 2.0 etc?
Thanks
Steven
Yes, you can still target framework 2.0 in VS2010. And you can also run VS2008 alongside VS2010.
Basically, yes, but there are a few things that get changed, for instance:
Testing projects always get converted to .NET 4.0
Project files get stored in "VS 2010" format.
So downgrading back to VS 2008 is not directly possible (in 99% of all cases it's still not a problem by hand-editing the files, takes just a few seconds).
However, usually, this is not an issue though. Your deployment capabilities are not limited by that. You can still target any framework.
Additionally, I found that running VS 2008 alongside 2010 made no problems at all. Including 2008 projects in a 2010 solution works fine and does not change the project file. It's very easy to slowly transmit to the new version step-by-step.

Resources