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

.NET 2.0 Code Challenge

Roy
Get the following code to compile using .NET 2.0. You can use VS Team Studio,
the command line complier, etc.

The restrictions are:
1. Place no code in the APP_CODE folder.
2. Do not create a second project that is referenced by the first.

The code is extremely simple:

1. Create a new web site
2. Add a new class to the project
3. In the Page_Load handler of default.aspx.cs, create a reference to the
new class.

For example:

in file Default.aspx.cs
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
TestClass tc = new TestClass();
}
}

in file TestClass.cs
public class TestClass
{
public TestClass()
{
}
}

That's it! Simple, yet, the code will not compile as is.
Dec 12 '05 #1
11 1407
Currently, the only way to get code to compile is to place it in the
APP_CODE folder. Why are you against doing this? This is the way
things are set up and until MS comes up with another way, then we will
have to stick with this method.

Dec 12 '05 #2
Roy
> Why are you against doing this?

I'm against it because I should be the one to decide on my project
structure...not Microsoft. Frankly, I'm surprised you had to ask.

Roy
Dec 12 '05 #3
Soon you will have the opportunity to use the same project structure in
Visual Studio 2005 as you are used in Visual Studio 2003. But for now code
placed in one of the special directories (that start with APP) will be
protected, the ISAPI filter will make sure that the content in these
directories are NOT accessible through http requests.

Gabriel Lozano-Morán
MCSD .NET
Real Software
http://www.realdn.be
http://www.realsoftware.be
Dec 12 '05 #4
You mean you haven't yet learned the golden rule of Microsoft
development?

"If you do it whichever way Redmond thought you should do it,
development will be a breeze. If you insist on doing it your own way,
development will be hell."

Otherwise known as, "Don't push on a rope," "Don't spit into the wind,"
etc.

I'm not being sarcastic... coming to C# after years of C / Java
programming, that's what I'm finding. :-)

Dec 12 '05 #5
And why would I want to do this?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.

"Roy" <Ro*@discussions.microsoft.com> wrote in message
news:A1**********************************@microsof t.com...
Get the following code to compile using .NET 2.0. You can use VS Team
Studio,
the command line complier, etc.

The restrictions are:
1. Place no code in the APP_CODE folder.
2. Do not create a second project that is referenced by the first.

The code is extremely simple:

1. Create a new web site
2. Add a new class to the project
3. In the Page_Load handler of default.aspx.cs, create a reference to the
new class.

For example:

in file Default.aspx.cs
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
TestClass tc = new TestClass();
}
}

in file TestClass.cs
public class TestClass
{
public TestClass()
{
}
}

That's it! Simple, yet, the code will not compile as is.

Dec 13 '05 #6
Well you can always create a dll and call your class up that way. At least
that's how MS envisions you doing it.

-Marc

"Bruce Wood" <br*******@canada.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
You mean you haven't yet learned the golden rule of Microsoft
development?

"If you do it whichever way Redmond thought you should do it,
development will be a breeze. If you insist on doing it your own way,
development will be hell."

Otherwise known as, "Don't push on a rope," "Don't spit into the wind,"
etc.

I'm not being sarcastic... coming to C# after years of C / Java
programming, that's what I'm finding. :-)

Dec 13 '05 #7
RCS
I'm afraid to ask if the command-line parameters are ok with you too.
Because Microsoft came up with those, and didn't check with you. I mean, you
should be able to type whatever command-line parameters you want, right?

Maybe I'm not getting it?

"Roy" <Ro*@discussions.microsoft.com> wrote in message
news:BF**********************************@microsof t.com...
Why are you against doing this?


I'm against it because I should be the one to decide on my project
structure...not Microsoft. Frankly, I'm surprised you had to ask.

Roy

Dec 13 '05 #8

"Roy" <Ro*@discussions.microsoft.com> wrote in message
news:A1**********************************@microsof t.com...
Get the following code to compile using .NET 2.0. You can use VS Team
Studio,
the command line complier, etc.

The restrictions are:
1. Place no code in the APP_CODE folder.
2. Do not create a second project that is referenced by the first.

The code is extremely simple:

1. Create a new web site
2. Add a new class to the project
3. In the Page_Load handler of default.aspx.cs, create a reference to the
new class.

For example:

in file Default.aspx.cs
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
TestClass tc = new TestClass();
}
}

in file TestClass.cs
public class TestClass
{
public TestClass()
{
}
}

That's it! Simple, yet, the code will not compile as is.


You can't do this with the current Web project model, a new project template
will be released soon that suits your needs. Please read this for more
details.

http://weblogs.asp.net/scottgu/archi...07/432630.aspx

Willy.

Dec 13 '05 #9
Roy
Thanks Willy. Your post was most helpful!!

Roy
Dec 13 '05 #10
Roy
> Maybe I'm not getting it?

Correct...you don't get it.

Roy
Dec 13 '05 #11
Why does it matter? Frankly, I'm surprised that you don't like the new
structure given exposure to VS 2003.

Then again, if you don't like the way VS handles your setup, you can always
use Notepad.

(Personally, I am using VWD Express (VS Lite) and I really like it. In the
past, I would use text editors for my development work because I didn't like
the way VS worked.)
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"Roy" <Ro*@discussions.microsoft.com> wrote in message
news:BF**********************************@microsof t.com...
Why are you against doing this?


I'm against it because I should be the one to decide on my project
structure...not Microsoft. Frankly, I'm surprised you had to ask.

Roy

Dec 13 '05 #12

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

Similar topics

2
by: Andy Leszczynski | last post by:
Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit http://www.pythonchallenge.com/ anybody get to the level 30? :-)
1
by: rshimizu12 | last post by:
dotnet hack challenge......................................???? Would be interesting to see a dotnet hack challenge. We have seen one security hole and it would be interesting to see what other...
42
by: Frank Buss | last post by:
I've setup a challenge, mainly for C++, Java and Lisp, but every other language is welcome: http://www.frank-buss.de/challenge/index.html There is nothing to win, but I hope there will be some...
8
by: Frank Buss | last post by:
A new challenge: http://www.frank-buss.de/marsrescue/index.html Have fun! Now you can win real prices. -- Frank Buß, fb@frank-buss.de http://www.frank-buss.de, http://www.it4-systems.de
21
by: Jim | last post by:
I am trying to write an HTTP/HTTPS proxy server in VB.Net 2005. But, I don't really even know how the internal workings of a proxy should act. Does anyone have anything on the protocols used in...
0
by: Richard Jones | last post by:
The date for the second PyWeek challenge has been set: Sunday 26th March to Sunday 2nd April (00:00UTC to 00:00UTC). The PyWeek challenge invites entrants to write a game in one week from...
0
by: richard | last post by:
The date for the second PyWeek challenge has been set: Sunday 26th March to Sunday 2nd April (00:00UTC to 00:00UTC). The PyWeek challenge invites entrants to write a game in one week from...
78
by: wkehowski | last post by:
The python code below generates a cartesian product subject to any logical combination of wildcard exclusions. For example, suppose I want to generate a cartesian product S^n, n>=3, of that...
2
by: donovan | last post by:
OK, so I know that there has been a lot of discussion on this topic, but none of the answers have been satisfactory. Therefore there seems to be only one thing to do: issue a challenge to all of...
3
by: Thierry | last post by:
For those interested in <b>programming riddles</b>, I would like to announce a new programming challenge I'm just launching at http://software.challenge.googlepages.com This challenge is in its...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.