Adding C# library reference to Silverlight project

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Abbas

    #1

    Adding C# library reference to Silverlight project

    Does anyone know how to utilize a C# class within a silverlight
    project?

    I was trying to add a reference to my non-silverlight Class Library
    and the VS 2008 IDE told me "You can only add project references to
    other Silverlight projects in the solution".

  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Adding C# library reference to Silverlight project

    Abbas,

    I don't think that you can do this. AFAIK, Silverlight uses a separate
    implementation of the CLR, and you can't add a reference to an assembly
    compiled for the .NET CLR, which is why you have to add a reference to
    another Silverlight project.

    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Abbas" <aljamala@gmail .comwrote in message
    news:1191191319 .914207.199000@ d55g2000hsg.goo glegroups.com.. .
    Does anyone know how to utilize a C# class within a silverlight
    project?
    >
    I was trying to add a reference to my non-silverlight Class Library
    and the VS 2008 IDE told me "You can only add project references to
    other Silverlight projects in the solution".
    >

    Comment

    • Ben Voigt [C++ MVP]

      #3
      Re: Adding C# library reference to Silverlight project


      "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard .caspershouse.c omwrote in
      message news:6D00D386-9599-4504-B165-E2FD8DC33BF1@mi crosoft.com...
      Abbas,
      >
      I don't think that you can do this. AFAIK, Silverlight uses a separate
      implementation of the CLR, and you can't add a reference to an assembly
      compiled for the .NET CLR, which is why you have to add a reference to
      another Silverlight project.
      IOW, you can reference the source files, but not the compiled output?
      >
      --
      - Nicholas Paldino [.NET/C# MVP]
      - mvp@spam.guard. caspershouse.co m
      >
      "Abbas" <aljamala@gmail .comwrote in message
      news:1191191319 .914207.199000@ d55g2000hsg.goo glegroups.com.. .
      >Does anyone know how to utilize a C# class within a silverlight
      >project?
      >>
      >I was trying to add a reference to my non-silverlight Class Library
      >and the VS 2008 IDE told me "You can only add project references to
      >other Silverlight projects in the solution".
      >>
      >

      Comment

      • Abbas

        #4
        Re: Adding C# library reference to Silverlight project

        >From what I have found is that you indeed cannot add a reference to a
        C# class library. All you can do is add the class as a link to your
        Silverlight project, but it will still be compiled using the
        Silverlight DLLs rather than the .NET CLR.

        On Oct 3, 10:31 am, "Ben Voigt [C++ MVP]" <r...@nospam.no spamwrote:
        "Nicholas Paldino [.NET/C# MVP]" <m...@spam.guar d.caspershouse. comwrote in
        messagenews:6D0 0D386-9599-4504-B165-E2FD8DC33BF1@mi crosoft.com...
        >
        Abbas,
        >
        I don't think that you can do this. AFAIK, Silverlight uses a separate
        implementation of the CLR, and you can't add a reference to an assembly
        compiled for the .NET CLR, which is why you have to add a reference to
        another Silverlight project.
        >
        IOW, you can reference the source files, but not the compiled output?
        >
        >
        >
        --
        - Nicholas Paldino [.NET/C# MVP]
        - m...@spam.guard .caspershouse.c om
        >
        "Abbas" <aljam...@gmail .comwrote in message
        news:1191191319 .914207.199000@ d55g2000hsg.goo glegroups.com.. .
        Does anyone know how to utilize a C# class within a silverlight
        project?
        >
        I was trying to add a reference to my non-silverlight Class Library
        and the VS 2008 IDE told me "You can only add project references to
        other Silverlight projects in the solution".

        Comment

        Working...