473,395 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

You must add a reference to assembly System.Xml

Hello

I upgraded my project from Visual Studio 2003 to 2005. The upgrade was
performed with no errors but now when I try to build my project (now it's in
..NET 2.0 not .NET 1.1 as was previously) I always get the following error:

Error 1 The type 'System.Xml.Serialization.IXmlSerializable' is defined in
an assembly that is not referenced. You must add a reference to assembly
'System.Xml, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'.
C:\Inetpub\wwwroot\EuroAdresPanels\FirmaFree.cs 26 21 EuroAdresPanels

What is funny I have got a reference to System.XML.

Below is the snippet of my code (the problematic is a line with private
DataTable TKon;):

using System;

using System.Diagnostics;

//\gjo

using System.Text;

using System.Collections;

using System.ComponentModel;

using System.Data;

using System.Data.SqlClient;

using System.Drawing;

using System.Web;

using System.Web.SessionState;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.HtmlControls;

using System.Xml;

namespace EuroAdresPanels

{
public class FirmaFree : System.Web.UI.WebControls.WebControl

{

private string NazwaFirmy = "";

private int id;

private DataRow[] RAdresy;

private DataTable TKon;

private DataTable TWoj;

private string emial = "";

//gjo

private DataTable TBranze;

private DataTable TSlowa;

//flaga mowiaca czy wyswietlamy tylko jedna firmy

public bool IsAlone = false;

//\gjo

public string ConnString = null;

public FirmaFree(int idfirmy, DataRow[] rAdresy, DataTable Kontakty,
DataTable TWojewodztwo, string miasto, int woj)

{

id = idfirmy;

TWoj = TWojewodztwo;

TKon = Kontakty;

RAdresy = rAdresy;

this.IsAlone = false;

this.TSlowa = null;

this.TBranze = null;

}

public FirmaFree(int idfirmy, DataRow[] rAdresy, DataTable Kontakty,
DataTable TWojewodztwo,

string miasto, int woj, DataTable TBranze, DataTable TSlowa, string
ConnString)

{

id = idfirmy;

TWoj = TWojewodztwo;

TKon = Kontakty;

RAdresy = rAdresy;

this.IsAlone = true;

this.TSlowa = TSlowa;

this.TBranze = TBranze;

this.ConnString = ConnString;
// this.IsAlone = SprawdzMaxBranz();

}

Any ideas how to deal with it?

Best Regards

Darek T.
May 11 '07 #1
4 13050
Dariusz,
Having a "using System.Xml" directive is not the same as having a reference.
For that, you must use the Add Reference item from Solution Explorer, and
explicitly choose the assembly System.Xml from the .NET Tab list.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Dariusz Tomon" wrote:
Hello

I upgraded my project from Visual Studio 2003 to 2005. The upgrade was
performed with no errors but now when I try to build my project (now it's in
..NET 2.0 not .NET 1.1 as was previously) I always get the following error:

Error 1 The type 'System.Xml.Serialization.IXmlSerializable' is defined in
an assembly that is not referenced. You must add a reference to assembly
'System.Xml, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'.
C:\Inetpub\wwwroot\EuroAdresPanels\FirmaFree.cs 26 21 EuroAdresPanels

What is funny I have got a reference to System.XML.

Below is the snippet of my code (the problematic is a line with private
DataTable TKon;):

using System;

using System.Diagnostics;

//\gjo

using System.Text;

using System.Collections;

using System.ComponentModel;

using System.Data;

using System.Data.SqlClient;

using System.Drawing;

using System.Web;

using System.Web.SessionState;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.HtmlControls;

using System.Xml;

namespace EuroAdresPanels

{
public class FirmaFree : System.Web.UI.WebControls.WebControl

{

private string NazwaFirmy = "";

private int id;

private DataRow[] RAdresy;

private DataTable TKon;

private DataTable TWoj;

private string emial = "";

//gjo

private DataTable TBranze;

private DataTable TSlowa;

//flaga mowiaca czy wyswietlamy tylko jedna firmy

public bool IsAlone = false;

//\gjo

public string ConnString = null;

public FirmaFree(int idfirmy, DataRow[] rAdresy, DataTable Kontakty,
DataTable TWojewodztwo, string miasto, int woj)

{

id = idfirmy;

TWoj = TWojewodztwo;

TKon = Kontakty;

RAdresy = rAdresy;

this.IsAlone = false;

this.TSlowa = null;

this.TBranze = null;

}

public FirmaFree(int idfirmy, DataRow[] rAdresy, DataTable Kontakty,
DataTable TWojewodztwo,

string miasto, int woj, DataTable TBranze, DataTable TSlowa, string
ConnString)

{

id = idfirmy;

TWoj = TWojewodztwo;

TKon = Kontakty;

RAdresy = rAdresy;

this.IsAlone = true;

this.TSlowa = TSlowa;

this.TBranze = TBranze;

this.ConnString = ConnString;
// this.IsAlone = SprawdzMaxBranz();

}

Any ideas how to deal with it?

Best Regards

Darek T.
May 11 '07 #2
Hi,

using System.Xml;

does *not* mean you'd have reference to System.Xml.dll assembly. It means
you are just importing that namespace, trying to shortcut the need to type
fully-qualified names of types residing in System.Xml namespace.

Namespaces are logical concepts, and they don't necessarily always go hand
in hand with assemblies. For example: System.Configuration namespace spans
two assemblies: System.dll and System.Configuration.dll

So, try taking the reference in VS with Add reference dialog (/right-click
project in solution explorer)
--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
"Dariusz Tomon" <d.*****@mazars.plwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Hello

I upgraded my project from Visual Studio 2003 to 2005. The upgrade was
performed with no errors but now when I try to build my project (now it's
in .NET 2.0 not .NET 1.1 as was previously) I always get the following
error:

Error 1 The type 'System.Xml.Serialization.IXmlSerializable' is defined in
an assembly that is not referenced. You must add a reference to assembly
'System.Xml, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'.
C:\Inetpub\wwwroot\EuroAdresPanels\FirmaFree.cs 26 21 EuroAdresPanels

What is funny I have got a reference to System.XML.

Below is the snippet of my code (the problematic is a line with private
DataTable TKon;):

using System;

using System.Diagnostics;

//\gjo

using System.Text;

using System.Collections;

using System.ComponentModel;

using System.Data;

using System.Data.SqlClient;

using System.Drawing;

using System.Web;

using System.Web.SessionState;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.HtmlControls;

using System.Xml;

namespace EuroAdresPanels

{
public class FirmaFree : System.Web.UI.WebControls.WebControl

{

private string NazwaFirmy = "";

private int id;

private DataRow[] RAdresy;

private DataTable TKon;

private DataTable TWoj;

private string emial = "";

//gjo

private DataTable TBranze;

private DataTable TSlowa;

//flaga mowiaca czy wyswietlamy tylko jedna firmy

public bool IsAlone = false;

//\gjo

public string ConnString = null;

public FirmaFree(int idfirmy, DataRow[] rAdresy, DataTable Kontakty,
DataTable TWojewodztwo, string miasto, int woj)

{

id = idfirmy;

TWoj = TWojewodztwo;

TKon = Kontakty;

RAdresy = rAdresy;

this.IsAlone = false;

this.TSlowa = null;

this.TBranze = null;

}

public FirmaFree(int idfirmy, DataRow[] rAdresy, DataTable Kontakty,
DataTable TWojewodztwo,

string miasto, int woj, DataTable TBranze, DataTable TSlowa, string
ConnString)

{

id = idfirmy;

TWoj = TWojewodztwo;

TKon = Kontakty;

RAdresy = rAdresy;

this.IsAlone = true;

this.TSlowa = TSlowa;

this.TBranze = TBranze;

this.ConnString = ConnString;
// this.IsAlone = SprawdzMaxBranz();

}

Any ideas how to deal with it?

Best Regards

Darek T.
May 11 '07 #3
Peter,

As I wrote I had the reference (in the solution explorer). I had also it in
using clause.
My problem was about having to projects in my solution and I had reference
in the wrong project. Now I added reference to the right one and it works as
expected.
Thank you very much.

Darek T.
"Peter Bromberg [C# MVP]" <pb*******@yahoo.yabbadabbadoo.comwrote in
message news:9D**********************************@microsof t.com...
Dariusz,
Having a "using System.Xml" directive is not the same as having a
reference.
For that, you must use the Add Reference item from Solution Explorer, and
explicitly choose the assembly System.Xml from the .NET Tab list.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Dariusz Tomon" wrote:
>Hello

I upgraded my project from Visual Studio 2003 to 2005. The upgrade was
performed with no errors but now when I try to build my project (now it's
in
..NET 2.0 not .NET 1.1 as was previously) I always get the following
error:

Error 1 The type 'System.Xml.Serialization.IXmlSerializable' is defined
in
an assembly that is not referenced. You must add a reference to assembly
'System.Xml, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'.
C:\Inetpub\wwwroot\EuroAdresPanels\FirmaFree.cs 26 21 EuroAdresPanels

What is funny I have got a reference to System.XML.

Below is the snippet of my code (the problematic is a line with private
DataTable TKon;):

using System;

using System.Diagnostics;

//\gjo

using System.Text;

using System.Collections;

using System.ComponentModel;

using System.Data;

using System.Data.SqlClient;

using System.Drawing;

using System.Web;

using System.Web.SessionState;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.HtmlControls;

using System.Xml;

namespace EuroAdresPanels

{
public class FirmaFree : System.Web.UI.WebControls.WebControl

{

private string NazwaFirmy = "";

private int id;

private DataRow[] RAdresy;

private DataTable TKon;

private DataTable TWoj;

private string emial = "";

//gjo

private DataTable TBranze;

private DataTable TSlowa;

//flaga mowiaca czy wyswietlamy tylko jedna firmy

public bool IsAlone = false;

//\gjo

public string ConnString = null;

public FirmaFree(int idfirmy, DataRow[] rAdresy, DataTable Kontakty,
DataTable TWojewodztwo, string miasto, int woj)

{

id = idfirmy;

TWoj = TWojewodztwo;

TKon = Kontakty;

RAdresy = rAdresy;

this.IsAlone = false;

this.TSlowa = null;

this.TBranze = null;

}

public FirmaFree(int idfirmy, DataRow[] rAdresy, DataTable Kontakty,
DataTable TWojewodztwo,

string miasto, int woj, DataTable TBranze, DataTable TSlowa, string
ConnString)

{

id = idfirmy;

TWoj = TWojewodztwo;

TKon = Kontakty;

RAdresy = rAdresy;

this.IsAlone = true;

this.TSlowa = TSlowa;

this.TBranze = TBranze;

this.ConnString = ConnString;
// this.IsAlone = SprawdzMaxBranz();

}

Any ideas how to deal with it?

Best Regards

Darek T.

May 11 '07 #4

If you already have the REFERENCE (not just the "using" statement)
Remove the Reference .. and re-add it.

Sometimes that'll clear it up.


"Dariusz Tomon" <d.*****@mazars.plwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Hello

I upgraded my project from Visual Studio 2003 to 2005. The upgrade was
performed with no errors but now when I try to build my project (now it's
in
.NET 2.0 not .NET 1.1 as was previously) I always get the following error:

Error 1 The type 'System.Xml.Serialization.IXmlSerializable' is defined in
an assembly that is not referenced. You must add a reference to assembly
'System.Xml, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'.
C:\Inetpub\wwwroot\EuroAdresPanels\FirmaFree.cs 26 21 EuroAdresPanels

What is funny I have got a reference to System.XML.

Below is the snippet of my code (the problematic is a line with private
DataTable TKon;):

using System;

using System.Diagnostics;

//\gjo

using System.Text;

using System.Collections;

using System.ComponentModel;

using System.Data;

using System.Data.SqlClient;

using System.Drawing;

using System.Web;

using System.Web.SessionState;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.HtmlControls;

using System.Xml;

namespace EuroAdresPanels

{
public class FirmaFree : System.Web.UI.WebControls.WebControl

{

private string NazwaFirmy = "";

private int id;

private DataRow[] RAdresy;

private DataTable TKon;

private DataTable TWoj;

private string emial = "";

//gjo

private DataTable TBranze;

private DataTable TSlowa;

//flaga mowiaca czy wyswietlamy tylko jedna firmy

public bool IsAlone = false;

//\gjo

public string ConnString = null;

public FirmaFree(int idfirmy, DataRow[] rAdresy, DataTable Kontakty,
DataTable TWojewodztwo, string miasto, int woj)

{

id = idfirmy;

TWoj = TWojewodztwo;

TKon = Kontakty;

RAdresy = rAdresy;

this.IsAlone = false;

this.TSlowa = null;

this.TBranze = null;

}

public FirmaFree(int idfirmy, DataRow[] rAdresy, DataTable Kontakty,
DataTable TWojewodztwo,

string miasto, int woj, DataTable TBranze, DataTable TSlowa, string
ConnString)

{

id = idfirmy;

TWoj = TWojewodztwo;

TKon = Kontakty;

RAdresy = rAdresy;

this.IsAlone = true;

this.TSlowa = TSlowa;

this.TBranze = TBranze;

this.ConnString = ConnString;
// this.IsAlone = SprawdzMaxBranz();

}

Any ideas how to deal with it?

Best Regards

Darek T.


May 11 '07 #5

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

Similar topics

0
by: Patrick | last post by:
This is a C# post. I'm using VB.NET to create an add-in for the Google Sidebar, and have implemented the OnDetailsView method. NOTE : I've come across this same problem (error message) even in...
5
by: Greg Collins [MVP] | last post by:
I have an ASP.NET page that uses a tag: <asp:Xml id="foo" runat="server" DocumentSource="rss.xml" TransformSource="rss20.xsl" /> This creates a Web page from an XML file that was generated by...
0
by: Rui Macdonald | last post by:
I working with some samples from angGoGo PhotoControl and when I start it I receive always the following message, can you help me please? :-( -------------------- The located assembly's manifest...
4
by: dhnriverside | last post by:
HI guys I've just written my first independent namespace for my library (yay me!). However, on trying to add it to my website project, it causes an error when I look at the website. It compiles...
5
by: serge calderara | last post by:
Dear all, I do not see the difference between Referencing an assembliy for use in my project and Register it on a page ? At the end if I want to use assembly functionnality , I need anyway to...
0
by: DotNet Guerrilla | last post by:
I deployed an application to our production server that has one web service reference and I am getting the following error. In my dev laptop work fine the error is in our prod server. Please...
3
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here...
9
by: bill | last post by:
I keep getting Object reference not set to an instance of an object error when trying to run my application on an installed client machine. I installed it on several others and it runs fine. I...
7
by: chage | last post by:
Hi, I have been searching around to try adding reference assembly to another assembly during runtime, programatically. Is this possible in .Net? The reason for this is because i am having...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.