-4

I am trying to work an F# tutorial on Pluralsight (see screencaps) where you have to install Xunit and write the tests but it's not working for me. It works fine for someone using Visual Studio as shown in the screencaps below, but I am not using Visual Studio. I'm on a Linux system using Monodevelop and I get this message: Composition error: the type 'Object' is required here and is unavailable. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

I think it must be the Assembly.fs file where I'm supposed to add the reference but I am not sure, nor do I know exactly how to add this reference correctly. Furthermore, I am unsure if the problem may be due to Monodevelop not recognizing a valid Linux path and if so, how to fix that. Any help would be greatly appreciated because I'm completely stuck.

enter image description here enter image description here

Here is the error I'm getting in Monodevelop:

enter image description here

super_J
  • 234
  • 2
  • 10
  • I think you are going to need to post a better example, it requires a decent amount of work to get the compiler to not reference that DLL (it should be done automatically). – John Palmer Jun 08 '15 at 10:23
  • 2
    Seriously - you are posting screenshots of a video which doesn't even show any errors? (or even an assembly.fs?) – John Palmer Jun 08 '15 at 10:54
  • I am on Linux, using Monodevelop. The screencaps are of the Pluralsight video tutorial which uses Visual Studio to show that the program works when done in VS, but that don't help someone who is on Linux using Monodevelop. – super_J Jun 09 '15 at 12:39
  • 1
    Its fine if you are on monodevelop - just show us enough to recreate your problem. If we can't recreate your problem, how can we solve it? – John Palmer Jun 10 '15 at 03:28
  • See the edited question, @John Palmer – super_J Jun 11 '15 at 05:47
  • Okay, so does a simple F# hello world app work? Also, I would check the `open SpeakerFS` which has red underlining - htat might be the real error. – John Palmer Jun 11 '15 at 08:47
  • Yes, a basic F# Hello World console app works – super_J Jun 11 '15 at 09:05

1 Answers1

0

As already mentioned in the comments, there is not enough information in your answer to give you a proper question. The error generally happens when you add reference to a dll that is itself referencing another dll and you do not have a reference to the other dll. So in general, you can fix this by adding the reference (as mentioned in the error message).

The specific assembly that you're getting an issue on is a core library referenced by portable .NET libraries. Try adding a reference as discussed for example here.

Otherwise, you need to give us more information - what type of project are you creating (what .NET version and profile) and what other libraries are you referencing in your project.

Community
  • 1
  • 1
Tomas Petricek
  • 240,744
  • 19
  • 378
  • 553
  • The Pluralsight tutorial uses Visual Studio in my screencaps to show that for someone (i.e. the Pluralsight tutorial) using Visual Studio, there's no problem. But I don't have Visual Studio. I'm on Linux and using Monodevelop. The project I am trying to create is an exact replication of Oliver Sturm's example in his Pluralsight tutorial. I am too new at learning .NET programming to know HOW to better frame my question when I don't have a CS education, and I am struggling as someone without access to resources. I didn't know how to add the reference. I thought I made that clear. – super_J Jun 09 '15 at 12:34
  • the more I am looking into this around Github, the more inclined I am to think that it may be a compiling problem within Xamarin and Monodevelopt. Because there's been problems reported about adding the packages for Xunit, which seems to be related to this problem. But I am unsure. – super_J Jun 11 '15 at 05:51