Eto: Visual Studio 2017 / Visual Studio for Mac / MonoDevelop 7 support

Created on 30 Mar 2017  ·  15Comments  ·  Source: picoe/Eto

Is there a timeline on adding this support? Or any pointers to how I could help achieve it?

Most helpful comment

Built using VS 2017 15.3 in Windows. No changes made in code. Just some reference correction from nuget, assembly and target framework to .Net 4.6

Finally every thing working as expected..

http://www.mediafire.com/file/5b84lz8sz053yut/Eto.Addin.VisualStudio.vsix

All 15 comments

No definitive timeline, but I want to get this done for the 2.4 release. I don't usually bother with releasing stuff for unfinished products (VS for Mac/MD 7), but it might be easy to support it since it doesn't appear to be many api breakages between 6 and 7.

If you'd like to help out, I can really use it. All the source is here. They need to be loaded up in the newer versions of VS and XS with the appropriate extension/addin authoring plugins installed, and tested.

There are some other outstanding items regarding the addins that need looking at too:

  • #582 - conditionally support MonoMac, or possibly remove it altogether since Xamarin.Mac is now open source.
  • #701 - conditionally support Xamarin.Mac, so it only loads the appropriate stuff when it is installed.
  • #601 - add templates for xaml-based form and dialog to XS.
  • #579 - Fix crashing with VS preview window, which has to do with how the appdomain is setup. I have a local branch with an attempt at fixing it, but I have yet to figure out why it does not kill the appdomain properly when reloading the preview.

Cheers!
Curtis.

I have made it work with Visual Studio for Mac.

I created a new directory in the Addins section for visual studio mac it is based off the existing xamarin studio version.

created pull request at https://github.com/picoe/Eto/pull/793

I have not actually run the extension just had it compile so may need more work

I couldn't get the add-in to work with VS2017. I'm not really into VS extension development and only tried to get the references to resolve somehow, but it fails with some weird file not found HRESULT upon creating a new Eto project.
Any official support on this?

Hey I created a .mpack file that you can use if you want.

https://github.com/anthonyirwin82/Eto/blob/develop/Visual-Studio-Mac-Extension-For-Eto.Forms-in%20mpack%20format/Eto.Addin.VisualStudioMac_2.3.0.6.mpack

In Visual Studio for Mac click the Visual Studio menu then click Extensions then click the Install from file button and select the .mpack file to install the extension.

This only works on VS on Mac not for windows version if that is what you where trying to do.

Thanks, but I required it for the classic Visual Studio 2017 desktop application on Windows.
Actually, I could build the .vsix for it now (using assemblies in my VSSDK directory rather than NuGet packages, don't really understand what's the difference but eh), but it can't really create projects, not being able to find the Eto.Forms NuGet packages somehow (including the available 2.3.0 one instead of the 2.4.0-alpha package when changing it to that). But at least the templates and designer work, the latter quite slow but good enough.

Please write a short update, if anything happens here.
Would be nice :-)

Built using VS 2017 15.3 in Windows. No changes made in code. Just some reference correction from nuget, assembly and target framework to .Net 4.6

Finally every thing working as expected..

http://www.mediafire.com/file/5b84lz8sz053yut/Eto.Addin.VisualStudio.vsix

I just downloaded and installed extension in Visual studio 2017 v 1.5.4.5 and it does not work.

Generating new Eto application throws error:
~
Eto.Forms.2.4.0-alpha: Unable to find version 2.4.0-alpha of package Eto.Forms
~

Any thoughts ?

Have you added eto myget to nuget repositories?

VS for Mac and MonoDevelop are now supported with #974. A new version of the addin will be published along with the 2.4 release, or you can build it manually.

I'm trying to use the new addin with VS for Mac but I'm a bit confused:
I can build Eto dll(s) from Visual Studio for Mac Eto\src\Eto.sln, and it works (updated the develop branch to commit ed2073c (1st Feb 2018, 20:19)
I can build the add-in from Etobuildbuild-addin.sh, a Eto.Addin.XamarinStudio_2.3.0.6.mpack gets created but the overall build fails.
Only the Eto.Forms.Templates.2.4.0-alpha.nupkg gets created in the Eto\artifacts\nuget\Release.
However the newly created addin installs successfully and I can create a new Eto project, but when I build it nuget complains with the message "Restore failed for 'Eto.Platform.Mac64 (>= 2.4.0-alpha)'".
Should I expect to have it in Eto\artifacts\nuget\Release?
If instead of using nuget I directly add to my solution Eto\src\Eto.csproj and Eto\src\Eto.Mac\Eto.Mac.csproj (or Eto\src\Eto.Mac\Eto.Mac64.csproj) and reference them where needed I can compile fine but when I run my application it crashes with the exception "Platform type Eto.MacPlatform, Eto.Mac64 was loaded but is not valid in the current context. e.g. Mac platforms require to be in an .app bundle to run."
What am I doing wrong?
Thanks

Hey @msasso69, to build the nuget packages you need to use the ./build.sh (on mac), and build.cmd (on windows). I usually do this via a share to a windows VM so they are both run on the same copy of the source files. This ensures the XamMac and Wpf nupkg files are created, which are mandatory for the addin templates.

You need the nuget packages to run the Mac/Mac64 platform as it sets up the proper .app bundle build, and tells VS on Mac to run the .app bundle instead of the .exe directly. This stuff is all in build/MacTemplate.

Thanks Curtis,
running ./build.sh I can now successfully build all the nuget packages and the initial Eto project created by the addin runs fine :)
However I'm not yet able to debug the Eto code, if I reference the Eto projects instead of using the nuget packages I still get the exception: "Platform type Eto.MacPlatform, Eto.Mac64 was loaded but is not valid in the current context. e.g. Mac platforms require to be in an .app bundle to run.".
The only difference that I found from the Eto test application (that I thought relevant) is a:

<UseMacTemplate>True</UseMacTemplate>

but even adding it nothing changes :(
I think I did not understand what you meant when you told me that everything is in the build/MacTemplate. How do I use it?
Thanks for your patience ;)

@msasso69, if you want to use Eto.Mac.csproj or Eto.Mac64.csproj directly without using their nuget packages, you will have to add <import Project="path/to/MacTemplate.targets" /> to your csproj. This is what <UseMacTemplate>True</UseMacTemplate> does for Eto's test projects via the Directory.Build.targets file. When using the nuget packages, this file is automatically imported into your project.

Other options include:
1) Use the MyGet nuget packages
2) Build the nuget packages and use them
3) Create a "XamMac Classic" project (difficult as isn't not readily available in VS for Mac, hence the new way this is done)
4) Use XamMac2 project

Hope this helps!
Curtis.

Fixed with #986

Was this page helpful?
0 / 5 - 0 ratings