473,698 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

.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.P age
{
protected void Page_Load(objec t 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 1426
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*@discussion s.microsoft.com > wrote in message
news:A1******** *************** ***********@mic rosoft.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.P age
{
protected void Page_Load(objec t 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*******@cana da.com> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.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*@discussion s.microsoft.com > wrote in message
news:BF******** *************** ***********@mic rosoft.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*@discussion s.microsoft.com > wrote in message
news:A1******** *************** ***********@mic rosoft.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.P age
{
protected void Page_Load(objec t 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

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

Similar topics

2
1942
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
1267
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 potential holes exist in .net...??
42
2971
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 interesting solutions at the end, so the win are the results :-) -- Frank Buß, fb@frank-buss.de
8
1704
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
1785
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 handling requests by proxies? I have Googled my eyes out....and found nothing. (BTW, props to Google for refusing the ridiculous request for their search results.)
0
1208
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 scratch either as an individual or in a team. Entries must be developed in Python, during the challenge, and must incorporate some theme chosen at the start of the challenge. REGISTRATION IS NOT YET OPEN --
0
1231
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 scratch either as an individual or in a team. Entries must be developed in Python, during the challenge, and must incorporate some theme chosen at the start of the challenge. REGISTRATION IS NOW OPEN --
78
4591
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 excludes '*a*b*' and '*c*d*a*'. See below for details. CHALLENGE: generate an equivalent in ruby, lisp, haskell, ocaml, or in a CAS like maple or mathematica. #------------------------------------------------------------------------------- # Short...
2
4702
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 the CSS gurus of the world to prove that CSS really can do what it claims to do. The challenge seems simple as first blush. We take a simple case of table-based layout: <table align="center" cellpadding="4">
3
1467
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 early stage and thus set to be continuously improved. I would be especially interested in your comments and feedbacks about this initiative and its relevance.
0
8673
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8892
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8860
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6518
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4614
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3043
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2327
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1998
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.