473,563 Members | 2,767 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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".

Sep 30 '07 #1
3 17652
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]
- mv*@spam.guard. caspershouse.co m

"Abbas" <al******@gmail .comwrote in message
news:11******** **************@ 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".
Oct 2 '07 #2

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c omwrote in
message news:6D******** *************** ***********@mic rosoft.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]
- mv*@spam.guard. caspershouse.co m

"Abbas" <al******@gmail .comwrote in message
news:11******** **************@ 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".

Oct 3 '07 #3
>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:6D* *************** *************** ***@microsoft.c om...
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:11******** **************@ 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".

Oct 4 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2182
by: Lady_A | last post by:
Hi, I need to add a reference to a static library (*.lib) to a COM/ATL project in VS.NET. Apparently if this library is not in my solution that is not possible using the ordinary way : Add Reference. The Add Reference Dialog only allows me to browse and add a *.dll,*.ocx,*.tlb, *.olb and *.exe. No *.lib! While if it is in the same...
2
5591
by: Neil Guyette | last post by:
Hello, All, It would be greatly appreciated if someone could throw me the bone on this question! I'm working on a project in Visual C++ .NET. I'm trying to generate a list of SQL servers that reside on my domain. For this to happen, I must add a reference to SQLDMO to my project. After I add the reference, I try to use the components...
0
1359
by: Nikhil Patel | last post by:
Hi all, I am having a problem adding a reference in an ASP.Net project. I have written a custom control using a Web Control Library project. I compiled this project and generated a dll. Now when I try to add a reference to this dll in an ASP.Net application, Visual Studio displays a message - In order to add this reference, the directory...
18
3763
by: Praveen Ramesh | last post by:
Hi, Is there any way to add the @Assembly reference to the aspx files programmatically from inside a custom control (when it gets dropped on to the page from the toolbox)? I have a custom control - MyControl that implements an interface in another custom assembly - InterfaceAssembly. When MyControl gets dropped on to the page and run, it...
3
2526
by: Mark | last post by:
I'm getting the following error when I add Access as a reference to my project: A reference to 'Microsoft Access 10.0 Object Library' could not be added. Converting the type library to a .NET assembly failed. A dependent type library 'OWC10' could not be converted to a .NET assembly. A depedent type library 'ADODB' could not be converted to...
0
2073
by: davec426913 | last post by:
I am having trouble with a reference in my VB.NET application. The code I am using is straight from MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmsrvsdk/htm/configuringbrdcstpubpt.asp Currently, it is barebones until I get this resolved. <code> Imports Microsoft.WindowsMediaServices.Interop Imports...
5
49788
by: Michael Russell | last post by:
Hi all, Using C#, I've created a simple wrapper class for using Excel. I have Office Pro 2003 installed on my devel machine. The wrapper class works great, reading and writing to/from Excel. To do this, I created a reference to "Microsoft Excel 11.0 Object Library", and have a "using Excel;" directive. I decided to add a method for...
1
2388
by: Jedufa | last post by:
following of thread: "Adding namespaces to code behind automatically" Hello, I had quite the same problem and got further in the right direction with your suggestions, thanks. Nevertheless, I have a newer problem which seems to come from the fact that the assembly which contains my "SimpleComponentToolboxItem" must be already referenced
0
7665
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7642
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.