2

I am a beginner in the Dot NET environment and not really happy with it from what I have read and done with Dot NET so far.

I need to migrate or write a program that will utilize ASP.NET with window Form Application. For whatever reason, I can't create this program as a single project. Am I miss understanding what Dot NET is or is that how Dot NET designed to be?

I have Delphi Prism(DP), which is based on Visual Studio 2010. Under DP, I can only create separate projects for ASP.NET and/or Windows Form Application. I can not seem to use little bit of both world under a single project. Is it even possible to do that?

My Delphi Prism Dot NET program is supposed to be part window based and part web-based. As a window based program, it is supposed to send and receive data on the serial port and network. As a web-based, it is supposed to give the user access to the window-based (server side) of the program on the Internet or LAN or Intranet.

I ran all their demos and searched online for help. Still, I am having hard time with it.

I am getting frustrated. I thought, programming in Dot NET was going to be a breeze, but it is turning out to be a problem. I should know this by now for Dot NET being Microsoft.

If anyone can give me hints or more information to help me understand Dot NET little better, I would appreciate it. Thank you.

Aaron McIver
  • 24,527
  • 5
  • 59
  • 88
ThN
  • 3,235
  • 3
  • 57
  • 115

3 Answers3

5

They are separate projects for separate problem domains. You would not and can not intermingle an ASP.NET project and a Windows Forms project.

Choose a project type and build out something simple. After you have crossed that bridge move that concept to another project type (WPF, Silverlight, ASP.NET MVC, etc...) and note the differences.

The underlying language will carry across projects such as C#, VB, etc...however the project type/framework will not.

Aaron McIver
  • 24,527
  • 5
  • 59
  • 88
  • @Aaron, So what is ASP.NET really for or its real purpose - to build database driven website or at minimum build a basic webpage to talk to a server? – ThN Jun 17 '11 at 20:44
  • @digitalanalog ASP.NET is a web application framework. Yes it could be used to build a database driven website or at minimum a basic webpage. StackOverflow is based on ASP.NET. Windows Forms (WinForms) on the other hand is for building out a desktop application. – Aaron McIver Jun 17 '11 at 20:47
  • @Aaron, pardon me for asking a stupid question. Other than the fact that Dot NET is based MFC or Frameworks and programs written in only Microsoft languages (F#, C#, VB) to be run by a Common Language Runtime(CLR), what is the real advantage to Dot NET programming? Because the more I am finding information about Dot NET on here and the Internet the more I think that Dot NET is not all that it hyped up to be. – ThN Jun 17 '11 at 21:06
  • 1
    First off, .NET is not MFC-based, other than the fact that Windows itself is built using the MFCs, and .NET has several libraries that leverage MFC code. Second, the .NET Framework provides a relatively simple platform with which to develop almost any type of program; there are libraries for native apps, web apps, mobile apps, etc etc. All of this can leverage a set of "core" libraries that are presentation-independent, allowing you to share common code between apps. The languages themselves, especially C#, also have some nice advantages over Java. It all depends on your task. – KeithS Jun 17 '11 at 22:03
  • The biggest disadvantage to .NET would probably be that it's a Microsoft product, and as such they can't come near Linux, Mac or Android with a 1000-ft pole without risking an antitrust suit. Mono helps with Linux, and C# and Java are close enough that you can go between the two without too much pain, but overall the limitation of .NET code to Microsoft-based platforms (except for web) in an age where Microsoft is no longer as dominant is probably the biggest drawback. – KeithS Jun 17 '11 at 22:08
  • @KeithS Not to shoot the messenger, but basically Microsoft took all their classes and created new ones only to bunch them together calling them Dot NET (Framework). On top of that they came up with a runtime environment that managed only their compiled languages (F#, C#, J#, VB). This is much like C++ with re-usability call it "leverage" or what not. I think people are being mislead by Microsoft. Why would you need Microsoft Dot NET environment to build a "server-scripted" website when there a lots of other options? – ThN Jun 18 '11 at 17:31
  • We originally thought from what we found out, Dot NET was easily going to help us create or migrate our software for the WEB. So, either your whole program is ASP.NET Web program or Window Form Application. Apparently, Dot NET is very limited. – ThN Jun 18 '11 at 17:37
  • Well first, the best presentation technologies in the world are only as good as the designs that use them. If you want to use .NET to maintain a web application and a Windows application with a common codebase, you HAVE to minimize the presentation layer, probably with an MVC-style code structure allowing a common model and possibly common controllers. This is true in almost any environment; there are presentation-specific "gotchas" in practically every language and framework. – KeithS Jun 20 '11 at 15:49
  • Second, .NET is not a "migration tool". You don't take old code, put it in .NET and expect it to magically go anywhere in the computer world. It is quite simply a set of libraries that allow you to quickly code what you need in 99.9% of business applications without dealing with the ugly cruft of MFC, coupled with a "common language runtime" that provides Java-esque managed memory control, code security, source language independence, reflection, etc. with a minimum of hassle to the developer. – KeithS Jun 20 '11 at 15:57
  • 2
    So, if you don't think .NET will suit your needs, quit trolling and pick another runtime. You can code in unmanaged C++ with the MFCs. You can code in PHP or JSP for web. You can code in Ruby or Python for scripting. You can code in Erlang for high-uptime services. Maybe when you have 50 devs coding in 5 languages with virtually zero code reuse you'll start to see the benefits of a common language with a common framework that at least allows the ability to re-use code. – KeithS Jun 20 '11 at 16:01
2

They are designed to do two completely different things. Windows Forms, or just Winforms, is a .NET 2.0 technology designed to create executable applications that run in Windows. ASP.NET is designed to use the basic .NET Framework as a server-side engine behind a web application that serves up HTML pages to a web browser.

There are ways to use HTML within a Winforms app, and ways to invoke .NET winforms apps from HTML, but traditionally they are two uses of the basic .NET Framework to target two different end-user experiences.

KeithS
  • 70,210
  • 21
  • 112
  • 164
  • So what is ASP.NET really for or its real purpose - to build database driven website or at minimum build a basic webpage to talk to a server? – ThN Jun 17 '11 at 20:49
  • 1
    ASP.NET's basic purpose is to build a "server-scripted" website, similar to what you'd use PHP or JSP for. It was the next step after classic ASP, which didn't use the .NET Framework. – KeithS Jun 17 '11 at 21:25
  • Again what makes ASP different now that it is using .NET Framework? This is how I see Dot NET to be. It is a Microsoft compiled list of classes and they made it convenient for their users to get access to them, but now you need their new special run-time environment or you can't run your program at all much like Java Applet to Java RunTime Environment. That is what I think of Microsoft's Dot NET. ASP has always been ASP nothing really has changed other than the fact that Microsoft has made few changes. – ThN Jun 18 '11 at 17:22
  • 1
    Frankly, if you don't think the .NET Framework has value, then don't use it. I've told you the main advantages to .NET, and you have rejected them. I think you're quite naive to think that any other language or framework with the possible exception of Java has anything close to the interop capabilities of .NET, but if you can find one, then quit trolling and use it. – KeithS Jun 20 '11 at 16:03
1

I think you'll have to create two separate projects. The problems and especially their platforms are completely different.

Ladislav
  • 418
  • 4
  • 8
  • So what is ASP.NET really for or its real purpose - to build database driven website or at minimum build a basic webpage to talk to a server? – ThN Jun 17 '11 at 20:50
  • ASP.NET is a web server technology you can use to build any web application. Basically, using ASP.NET you create dynamic web pages that can use arbitrary data sources (a database for example). A collection of these pages is called a web application. On the other hand, if you need to use the resources of a local computer (a serial port), you'll definitely have to write a desktop application (probably using WinForms), just like you'd do in C++/Delphi/whatever. – Ladislav Jun 17 '11 at 21:12