Building a Basic ASP.NET Site Using IronPython
❘
239
Interestingly enough, the scripting nature of IronPython makes it possible to use IronPython to test
your Web application. This gives you an advantage over compiled languages such as C# and Visual
Basic.NET. Chapter 18 tells you more about using IronPython for application testing.
Considering debugging
You may be wondering whether this project can provide any debugging. The fact is that you don’t
get direct debugging when working with DLR, even if you use a full Web server. However, there are
four ways in which you can debug your application.
➤
Use print statements and other old standbys to determine what your application is doing.
➤
➤
➤
Attach the debugger to the running process after the fact by choosing Debug
➤➤➪➤➤
Attach to
Process within Visual Studio.
➤
➤
Import the
Microsoft.Scripting.Debugging.DLL
found in the
\Program Files\
IronPython 2.6
folder and add debugging information manually.
➤
➤
Rely on the output error message from the Web server, such as the one shown in
Figure 11-10.
FIguRE 11-10:
The Web server provides you with error messages as needed.
548592c11.indd 239
2/24/10 12:48:41 PM
www.finebook.ir
240
❘
CHAPTER 11
Developing ASp.neT ApplicATionS
uSINg IRoNPyTHoN CoNSTRuCTIVEly
This chapter demonstrates that it’s possible to use IronPython to create a Webforms application.
In fact, given enough time, you can create a Webforms application of any complexity. However,
it’s the time factor that’s a problem right now. Without proper support for project templates and
IntelliSense, you’ll spend a lot of time using IronPython to create a production Webforms applica-
tion. In addition, unlike a Windows Forms application, you have to use DLR to make Webforms
applications work and DLR isn’t in released form yet. Experimentation is the name of the game for
now. Even so, as you’ve seen, IronPython can be a lot of fun to use for Webforms development.
Even though Webforms use isn’t quite ready for prime time, you should still take time to experiment.
At the very least, try the example programs that come with DLR to see that IronPython is a viable
Web development language. Use the example application in this chapter as a starting point for your
own experimentation. In short, have a bit of fun using IronPython to create Web pages. Consider
how the dynamic nature of IronPython could help you in future Web application development,
because DLR won’t remain in alpha status forever.
Chapter 12 considers an extremely important need for any developer — application debugging. Unlike
debugging a C# or Visual Basic.NET application, IronPython holds a few surprises — mainly because
this language isn’t built into the Visual Studio IDE. Even so, you can use the Visual Studio IDE to debug
an IronPython application and many developers do just that. Chapter 12 helps you understand the ins
and outs of this process.
548592c11.indd 240
2/24/10 12:48:41 PM
www.finebook.ir
Do'stlaringiz bilan baham: |