MonoTouch in Visual Studio

by ManniAT 18. November 2009 18:31
Technorati-Tags: ,,

After doing my first steps with MonoTouch using MonoDevelop I decided that this is not they way I want to work.

First the MacBook - Shit+Alt+7 for Backslash At wits end

I added an external keyboard plus keyboard layouts to my MacBook, I changed CTRL / OPT / COMMAND…
But there are still things I really hate.
You press “End” – which brings you to the end of the file.
Ctrl+Left is not a word left – it’s beginning of line – and so on.

This turns my productivity down.
I worked with Windows for more than 17 years (mostly with the keyboard) – and you often see me typing:
Shift+Ctrl+Left, Shift+Ctrl+Left, Ctrl+C, Down, End, Ctrl+V….

Further MonoDevelop has problems with multiple screens.
Refractoring is poor, I miss: addons, instant macros, splitting windows,…

I decided to look for a different solution and found that Visual Studio can open MonoTouch projects (solutions).
The only problems:

  • An error because of an unknown project type (removing one line from .csproj fixes this)
  • A missing reference to monotouch.dll

To fix this I wrote a little program which creates a Visual Studio solution from a MonoTouch Solution.
It also adds a csproj.user to include a reference path where I place my monotouch DLLs at the PC.
You can find those DLLs at “Mac Harddrive\Developer\MonoTouch\usr\lib\mono\2.1” (2.1 or other version).

I place my MonoTouch projects on a shared volume – so I can have them open in VS for editing – and in MonoDevelop (on my Mac) for building / testing / design (XIB) at the same time.

One problem is left with this solution: I need my Mac to “error check compile” my solution.
Some errors are seen by Visual Studio – some not (since I can’t build in VS).

The solution for this comes from telerik – it is called JustCode.

I already use JustCode (as Telerik MVP I was on the internal beta) and I love it.
I never thought this tool could help me with my iPhone development – but I learned that it does this job very well.

Beside the other cool features JustCode brings to Windows Development it also analyzes the code you enter.
It finds (and helps you to solve) problems / error without the need to compile your project.

Once again telerik made my live much easier Happy

JustCode is “open beta” now – so you can download the JustCode for free.
It is “just a refactoring tool like the others” – with one big difference: incredible speed!!!

You can download my little tool (.NET 3.5 WinForms) from here:
VSMTouch (Setup.exe + MSI) 400k
VSMTouch (MSI only) 200k

Update Version that supports multiple projects in one solutin: VSMTouch (Setup + MSI ) 400k

This software is provided “as it is” – no support,….

Getting started:

  1. Install VSMTouch
  2. Create a “RefLibs” directory somewhere on you PC
  3. Copy the MonoTouch DLLs from you Mac to this directory
  4. (optional) Download JustCode from telerik
  5. (optional) Install JustCode
  6. Run VSMTouch
  7. Select the directory where you placed you MonoTouch DLLs as “Reference Path”
  8. Select you MonoTouch solution
  9. Click Create
  10. Open the new oldname$VS.sln solution in Visual Studio

 

Have Fun
Manfred

Tags: ,

MonoTouch | telerik

Comments (19) -

11/20/2009 7:27:45 AM #

Ali Shafai

Great job mate. next step is if I could press F5 and have it call the mtouch commandline stuff to link the project. do you think this is possible?

Cheers,
Ali

Ali Shafai Australia | Reply

11/21/2009 12:18:43 PM #

ManniATa

@Ali: mhutch told something in this thread forums.monotouch.net/.../Thread.aspx
I asked him if / how this can be done - waiting for an answer...

ManniATa Austria | Reply

11/21/2009 8:21:44 PM #

Alex York

Great article.

Have you used ReSharper? How does JustCode compare to it?

Alex York United Kingdom | Reply

11/22/2009 9:55:23 PM #

ManniAT

@Alex: yes I did - and most of the time I turned it of (due to laggs in VS) and only activated it for "resharping sessions".
Just code offers all the functionallity I need - but they only "performance issue" is when you open a project (it takes noteable longer).
But after this - no "laggs" when I type and I would say "you don't feel JustCode".

ManniAT Austria | Reply

12/10/2009 1:54:51 PM #

Pete

This looks like a great app - cheers.
Just wondering... when I open the solution that I have converted with VSMTouch in MonoDevelop, I can't see Main.cs or any of the other files I expect to see in the project. I just see References and {} with the name of my project beside it. Is this expected? How do I get to the interface builder?

Pete United Kingdom | Reply

12/10/2009 5:11:56 PM #

ManniAT

@Pete: to explain the things.
You create a solution in MonoTouch (add project elements there and so on).
Then you use VSMTouch to create a VS solution out of this.
This add's references, removes the "Projecttypeid" and such things.
Now you work with the solution in VS.
In MonoTouch you use the "old solution".
And (I didn't implement "convert back") - adding project elements is done in MonoTouch. After this simply run VSMTouch again. (VS will tell you "project modified" if it's still open).
The reason for this "missing feature" is that MonoTouch has templates not available in VS and it is not a big thing to add project elements there.
I normally add a lot of at one time (sometimes I plan what I do Smile) - so it's not a big thing to do this on the mac in one session and after this switch back to the PC.
That is (by the way) the main reason why I built this tool - to have an easy way to refresh changed project for the use in VS.

ManniAT Austria | Reply

12/12/2009 2:27:51 PM #

Matteo

Hi,

for your problem with Home and End button you can use this program:

http://doublecommand.sourceforge.net/features.html

It changes Home/End behavior like windows.

Great tools.


I've a question: If I use Visual Studio Can I compile and run the application? If not how can I compile it? I need to use always MonoDevelop?

bye

Matteo Italy | Reply

12/12/2009 5:34:22 PM #

ManniATa

Hi Matteo,

first of all thank you for the tip about home/end.
I allready have my G15 attached to the Mac and a custom key mapping.
But my problem goes much further (VS key combinations, refactoring, macros,...)

About "Compiling"
I use teleriks JustCode (http://www.telerik.com/products/justcode.aspx ) which gives me almost the same as a build (error check, and so on).
Since an iPhone (Simulator) app will not run on windows I don't care about it.

I guess there is a way to compile in VS - take a look at this.
lists.ximian.com/.../001545.html

The clear answer to "If I use VS can I compile and run..." is
a.) Compile I think so (never did)
b.) Run - sorry no bounus Smile

ManniATa Austria | Reply

3/2/2010 6:31:12 PM #

Chris

Thanks for the guide. You don't need to reconstruct your csproj files completed, I've written about it here: shrinkrays.net/.../...touch-tips-and-snippets.aspx

Chris United Kingdom | Reply

3/2/2010 6:31:44 PM #

Chris

*completely

Chris United Kingdom | Reply

4/9/2010 10:38:26 AM #

Definitely

Superb read, I just passed this onto a coursemate who was performing a small research on that. And he actually purchased me lunch simply because I discovered it for him. So allow me rephrase that: Many thanks for lunch!

Definitely United States | Reply

6/19/2010 7:42:27 AM #

Traslochi a Milano

This is so cool..thanks so much for the info. Love it!

Traslochi a Milano United States | Reply

8/20/2010 2:33:31 PM #

Kelthar

I have created something else for people who work with Xna for MonoTouch. Or XnaTouch. It converts the solutions and projects, extending using statements and other things. The beta will be available in a week or so:

kelthar.wordpress.com/.../

Kelthar Sweden | Reply

9/9/2010 12:10:25 PM #

javed

awesome, very helpful, thanks Smile

javed New Zealand | Reply

10/22/2010 5:59:39 AM #

telephone systems northeast mississippi

wow! great Mtouch in visual studio I think I could use these information in my project...thanks a lot for the good postSmile

telephone systems northeast mississippi United States | Reply

10/22/2010 7:38:12 AM #

Vinyl Siding Augusta ga

very informative! I was really impress that there's a monotouch  in visual studio this is going to be a help in my new project in visual studio...thanks a lot for the so much informationSmile

Vinyl Siding Augusta ga United States | Reply

11/15/2010 2:11:28 PM #

animation studio

A wonderful artical.
Cheers

animation studio United States | Reply

11/21/2010 1:03:06 AM #

yemek tarifleri

I like such shares. I started to follow site. Thank you editor

yemek tarifleri Turkey | Reply

12/7/2010 12:04:18 PM #

pandora bracelets

This is really a marvelous source of data, Im pleased I read this article. I am going to be returning soon to look at more that you have.

pandora bracelets United States | Reply

Pingbacks and trackbacks (3)+

Add comment




  Country flag
biuquote
  • Comment
  • Preview
Loading


Powered by BlogEngine.NET 2.0.0.0