473,387 Members | 1,388 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,387 software developers and data experts.

multiple class instances

i am doing the walkthrough of an asp.net book and i have
come to one of the tutorials where i am supposed to
create a simple code behind method. but, when i follow
the instructions in the book i get this error message.
considering that i am following a walkthrough i would
like to iorn out this problem ASAP so i can continue...
here is the error message:

Compiler Error Message:
CS1595: 'Temperature.TemperatureCB' is defined in
multiple places; using definition
from 'C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705
\Temporary ASP.NET Files\mcsd\63097906\8e1380c7
\adecz8jd.dll'

and here is the simple code definition of the cs file:
//TemperatureCB.cs
//Define a namespace
namespace Temperature
{
//Define TemperatureCB class
public class TemperatureCB : System.Web.UI.Page
{
//Define ToCensius() method
double ToCelsius(double f)
{
//Calculate and return
return (5.0/9.0)*(f-32.0);
}

//Define the CreateTemperatureTable()
method
public void CreateTemperatureTable()
{
for (double f = 50.0; f<=100.0;
f++)
{
Response.Output.Write(
"<tr><td>{0}
</td><td>" +
"{1:f}</td><tr>",
f, ToCelsius(f));
}
}
}
}

and here is the asp file exactly as i have been running
it..


<! -- StepByStep1_7.aspx -->
<%@ Page Language="C#"
Inherits="Temperature.TemperatureCB"
Src="TemperatureCB.cs"%>
<html>
<body>
<h2>Fahrenheit to Celsius Conversion
Chart</h2>
<table border="2">
<tr>
<th>
&deg
Fahrenheit</th>
<th>
&deg Celsius</th>
</tr>
<%CreateTemperatureTable();%>
</table>
</body>
</html>

any help would be appreiciated...
Nov 18 '05 #1
3 1232
This message indicates that you have duplicate class names within the same
namespace. Are you sure there is not another .cs file in your project with
the same class name?
"david" <li*@dodo.com.au> wrote in message
news:00****************************@phx.gbl...
i am doing the walkthrough of an asp.net book and i have
come to one of the tutorials where i am supposed to
create a simple code behind method. but, when i follow
the instructions in the book i get this error message.
considering that i am following a walkthrough i would
like to iorn out this problem ASAP so i can continue...
here is the error message:

Compiler Error Message:
CS1595: 'Temperature.TemperatureCB' is defined in
multiple places; using definition
from 'C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705
\Temporary ASP.NET Files\mcsd\63097906\8e1380c7
\adecz8jd.dll'

and here is the simple code definition of the cs file:
//TemperatureCB.cs
//Define a namespace
namespace Temperature
{
//Define TemperatureCB class
public class TemperatureCB : System.Web.UI.Page
{
//Define ToCensius() method
double ToCelsius(double f)
{
//Calculate and return
return (5.0/9.0)*(f-32.0);
}

//Define the CreateTemperatureTable()
method
public void CreateTemperatureTable()
{
for (double f = 50.0; f<=100.0;
f++)
{
Response.Output.Write(
"<tr><td>{0}
</td><td>" +
"{1:f}</td><tr>",
f, ToCelsius(f));
}
}
}
}

and here is the asp file exactly as i have been running
it..


<! -- StepByStep1_7.aspx -->
<%@ Page Language="C#"
Inherits="Temperature.TemperatureCB"
Src="TemperatureCB.cs"%>
<html>
<body>
<h2>Fahrenheit to Celsius Conversion
Chart</h2>
<table border="2">
<tr>
<th>
&deg
Fahrenheit</th>
<th>
&deg Celsius</th>
</tr>
<%CreateTemperatureTable();%>
</table>
</body>
</html>

any help would be appreiciated...

Nov 18 '05 #2

I think the problem is that the src attribute is set on the page *and
by default the BuildAction attribute of the code-behind file is set t
'compile' causing the file to be compiled twice, once by Visual Studi
and then again on the web server.

The Errata for the book says:
"In Step By Step 1.7, after step 3, access the Properties window fo
the TemperatureCB.cs file and change its Build Action property t
None."

The errata can be found here
http://www.techcontent.com/TG70315Errata.htm

Scott M. wrote:
*This message indicates that you have duplicate class names withi
the same
namespace. Are you sure there is not another .cs file in you
project with
the same class name?
"david" <li*@dodo.com.au> wrote in message
news:00****************************@phx.gbl...
i am doing the walkthrough of an asp.net book and i have
come to one of the tutorials where i am supposed to
create a simple code behind method. but, when i follow
the instructions in the book i get this error message.
considering that i am following a walkthrough i would
like to iorn out this problem ASAP so i can continue...
here is the error message:

Compiler Error Message:
CS1595: 'Temperature.TemperatureCB' is defined in
multiple places; using definition
from 'C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705
\Temporary ASP.NET Files\mcsd\63097906\8e1380c7
\adecz8jd.dll'

and here is the simple code definition of the cs file:
//TemperatureCB.cs
//Define a namespace
namespace Temperature
{
//Define TemperatureCB class
public class TemperatureCB : System.Web.UI.Page
{
//Define ToCensius() method
double ToCelsius(double f)
{
//Calculate and return
return (5.0/9.0)*(f-32.0);
}

//Define the CreateTemperatureTable()
method
public void CreateTemperatureTable()
{
for (double f = 50.0; f<=100.0;
f++)
{
Response.Output.Write(
"<tr><td>{0}
</td><td>" +
"{1:f}</td><tr>",
f, ToCelsius(f));
}
}
}
}

and here is the asp file exactly as i have been running
it..


<! -- StepByStep1_7.aspx -->
<%@ Page Language="C#"
Inherits="Temperature.TemperatureCB"
Src="TemperatureCB.cs"%>
<html>
<body>
<h2>Fahrenheit to Celsius Conversion
Chart</h2>
<table border="2">
<tr>
<th>
&deg
Fahrenheit</th>
<th>
&deg Celsius</th>
</tr>
<%CreateTemperatureTable();%>
</table>
</body>
</html>

any help would be appreiciated...

-
morganm
-----------------------------------------------------------------------
Posted via http://www.mcse.m
-----------------------------------------------------------------------
View this thread: http://www.mcse.ms/message127281.htm

Nov 18 '05 #3

I think the problem is that the src attribute is set on the page *and
by default the BuildAction attribute of the code-behind file is set t
'compile' causing the file to be compiled twice, once by Visual Studi
and then again on the web server.

The Errata for the book says:
"In Step By Step 1.7, after step 3, access the Properties window fo
the TemperatureCB.cs file and change its Build Action property t
None."

The errata can be found here
http://www.techcontent.com/TG70315Errata.htm

Scott M. wrote:
*This message indicates that you have duplicate class names withi
the same
namespace. Are you sure there is not another .cs file in you
project with
the same class name?
"david" <li*@dodo.com.au> wrote in message
news:00****************************@phx.gbl...
i am doing the walkthrough of an asp.net book and i have
come to one of the tutorials where i am supposed to
create a simple code behind method. but, when i follow
the instructions in the book i get this error message.
considering that i am following a walkthrough i would
like to iorn out this problem ASAP so i can continue...
here is the error message:

Compiler Error Message:
CS1595: 'Temperature.TemperatureCB' is defined in
multiple places; using definition
from 'C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705
\Temporary ASP.NET Files\mcsd\63097906\8e1380c7
\adecz8jd.dll'

and here is the simple code definition of the cs file:
//TemperatureCB.cs
//Define a namespace
namespace Temperature
{
//Define TemperatureCB class
public class TemperatureCB : System.Web.UI.Page
{
//Define ToCensius() method
double ToCelsius(double f)
{
//Calculate and return
return (5.0/9.0)*(f-32.0);
}

//Define the CreateTemperatureTable()
method
public void CreateTemperatureTable()
{
for (double f = 50.0; f<=100.0;
f++)
{
Response.Output.Write(
"<tr><td>{0}
</td><td>" +
"{1:f}</td><tr>",
f, ToCelsius(f));
}
}
}
}

and here is the asp file exactly as i have been running
it..


<! -- StepByStep1_7.aspx -->
<%@ Page Language="C#"
Inherits="Temperature.TemperatureCB"
Src="TemperatureCB.cs"%>
<html>
<body>
<h2>Fahrenheit to Celsius Conversion
Chart</h2>
<table border="2">
<tr>
<th>
&deg
Fahrenheit</th>
<th>
&deg Celsius</th>
</tr>
<%CreateTemperatureTable();%>
</table>
</body>
</html>

any help would be appreiciated...

-
morganm
-----------------------------------------------------------------------
Posted via http://www.mcse.m
-----------------------------------------------------------------------
View this thread: http://www.mcse.ms/message127281.htm

Nov 18 '05 #4

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

Similar topics

4
by: SilverShadow | last post by:
Hello, I'm having trouble with something that may be easily remedied. I use Cantera running on Python. I need to make multiple "Reactor()" objects and have them assigned a different (user...
1
by: DraguVaso | last post by:
Hi, I found some examples for storing the FormSettings of a Form in an XML-file, but none of these could match my criteria: What I am looking for is the possibility to save the FormSettings of...
3
by: Michel | last post by:
Hi, I wrote an app in .Net and I whant only 1 instance of this app open for the user; the user open my app, do some works and try to open another instance of my app, I whant to show a message to...
11
by: Olie | last post by:
This post is realy to get some opinions on the best way of getting fast comunication between multiple applications. I have scowered the web for imformation on this subject and have just found...
6
by: John Salerno | last post by:
My code is below. For now I'm focusing on the lines where health (and armor) are increased in each character class. Let's say I decided to change the amount of increase in the future. As it is now,...
4
by: Mike | last post by:
Class A public objX I want to create 2 or more instances of Class A and have the same value for objX in all instances. Instance1 of Class A Instance2 of Class A Instance3 of Class A
0
by: rbg | last post by:
Have a web application which uses Data Cache. I need to understand what happens when a new instance of the same web application is created for for serving concurrent clients. What happens when...
6
by: Bugs | last post by:
Does anyone have any recommendations on the best way to create multiple instances of the same class when the final number of instances is unknown? For example, I have a class and based on some...
3
by: =?Utf-8?B?VG9kZA==?= | last post by:
What is the memory footprint of static methods of a windows app running on a server when the server spins up multiple instances of the application? In my envirionment, we have a Citrix server...
5
by: pgrazaitis | last post by:
I cant seem to get my head wrapped around this issue, I have myself so twisted now there maybe no issue! Ok so I designed a class X that has a few members, and for arguments sake one of the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.