1

I was trying to use MonoDevelop on Windows to develop a C# application that needs to use Excel.Interop.

However, MonoDevelop does not seem to have access to assemblies that only reside in the Windows GAC:

Missing References

Is there any way to use MonoDevelop on Windows to develop with Windows-specific assemblies as well?

And yes, I am aware of SharpDevelop and C# Express, however both are missing VI-keybindings that are really important to me.

Edit: Screenshot of the expanded error:

enter image description here

5
  • VIM keybindings for visual studio (i think VI and VIM have similar keybinds) visualstudiogallery.msdn.microsoft.com/… Commented Jun 30, 2012 at 9:34
  • @LukeMcGregor I know those and use them at work - at home I don't have a full edition of Visual Studio and as far as I understand it the Express versions don't allow installing extensions? Commented Jun 30, 2012 at 9:36
  • hmm maybe you are right, perhaps this one isn't compatible with VS Express. i know you can specify express when you make the extension, you might be able to hack it by modifying the vsix file to install to vs express Commented Jun 30, 2012 at 9:39
  • Ah at least I found out why MonoDevelop is not finding the assemblies: MonoDevelop and GAC. Commented Jul 1, 2012 at 10:39
  • @mhutch Sure - but I think i figured out why it did not work - MonoDevelop does not check the GAC (SharpDevelop - which I tested as well - does) - so I had to copy the assemblies I need from the GAC to a location where I could access them (just used xcopy based on the SharpDevelop paths) - however, as I used WPF I still could not use MonoDevelop as it can not compile the WPF-related files - maybe I'll see if I can use GTK#. Commented Jul 1, 2012 at 17:31

1 Answer 1

2

MonoDevelop (and Visual Studio) do not allow referencing assemblies from the GAC. At build time, assemblies are resolved from:

  1. frameworks
  2. assembly folders (when targeting the .NET toolchain)
  3. pkg-config (when targeting the Mono toolchain)

So, the problem depends whether you're targeting Mono or .NET - on Windows, MD can target either. In the simple case, it's probably .NET - if you don't have Mono installed, then it'll just target .NET, and the options won't show up. And Mono doesn't have WPF (Presentation*.dll) so you'd have to use .NET for this anyway. So I'll just talk about .NET.

This applies to Microsoft.Office.Interop.Excel.dll. It's possible that it's registered in an assembly folder already and MonoDevelop simply isn't finding it - MS adds new Assembly Folder registry keys occasionally, so maybe we didn't add them to MD yet - or maybe it only gets registered into an Assembly Folder if you install Visual Studio Tools for Office. You can register it pretty easily (see http://msdn.microsoft.com/en-us/library/wkze6zky(v=vs.110).aspx) or you could just reference it by path instead of by name. If you think it's registered but MD isn't picking it up, please file a bug.

PresentationCore.dll is trickier, since it's a framework assembly. MonoDevelop has an internal list of name of assemblies it knows to be in each framework, and knows where to look for then for .NET. We normally look for the 4.0 framework assemblies in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0 - but I think they'll only be there if you've installed VS (including Express) or the .NET SDK. We do have a fallback do look in C:\Windows\Microsoft.NET\Framework\v4.0.30319 but it looks like that doesn't work for PresentationCore.dll, since MS seems to have put it in a WPF subdirectory. I have fixed this in MD master, but it'll be a while until that gets into a release. For now, I would recommend installing the reference assemblies.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.