How to convert application written in asp.net 3.5 to 2.0? - asp.net

How to convert an application written in asp.net 3.5 to 2.0? I have a system in which there is only .net 2.0 . But my application is written in 3.5. I published that app using an another system (3.5 framework) and then I copy that published folder to my system (2.0 framework)and configured in IIS.When i try to browse,i got version problem error.

.NET 3.5 is 2.0 with a few extra libraries. So you can run them on the same web site. In fact you cannot even set a web application to run under 3.5. It just runs under 2.0.
ASP.NET 3.5 is still running on the .NET 2.0 CLR, if you go into IIS you'll see that you can only pick 2.0 or 1.1
So, if you REALLY want to go back to 2.0, replace all 3.5 stuff with 2.0 stuff: see the lists below.
The new stuff after 2.0 up to 3.5 is:
NET framework 3.0:
Includes a new set of managed code APIs that are an integral part of Windows Vista and Windows Server 2008 operating systems and provides
Windows Communication Foundation (WCF), formerly called Indigo; a service-oriented messaging system which allows programs to interoperate locally or remotely similar to web services.
Windows Presentation Foundation (WPF), formerly called Avalon; a new user interface subsystem and API based on XML and vector graphics, which uses 3D computer graphics hardware and Direct3D technologies.
Windows Workflow Foundation (WF) allows for building of task automation and integrated transactions using workflows.
Windows CardSpace, formerly called InfoCard; a software component which securely stores a person's digital identities and provides a unified interface for choosing the identity for a particular transaction, such as logging in to a website
.NET framework 3.5:
It implement Linq evolution in language. So we have the folowing evolution in class:
Linq for SQL, XML, Dataset, Object
Addin system
p2p base class
Active directory
ASP.NET Ajax
Anonymous types with static type inference
Paging support for ADO.NET
ADO.NET synchronization API to synchronize local caches and server side datastores
Asynchronous network I/O API
Support for HTTP pipelining and syndication feeds.
New System.CodeDom namespace.
If your application uses any of the above, you'd need to strip it out and replace with something not on the lists.

Related

Is it possible to host an ASP.NET MVC app without the .NET Core runtime or sdk?

I am struggling to understand how all these frameworks interact and depend on each other: .NET Core, .NET Framework, ASP.NET Core, MVC, etc.
This discussion leads me to believe that my MVC app uses ASP.NET Core and .NET Framework, but not .NET Core. If that's true, can I run the MVC app without the .NET Core runtime? If not, why is this app still dependent on the .NET Core runtime?
What I tried
I created a new project in Visual Studio 2017 as follows:
ASP.NET Core Web Application
MVC
.NET Framework
ASP.NET Core 2.1
I published the app as follows:
dotnet publish --self-contained false (to prevent the runtime from being included)
Deploy new ec2 instance with windows server 2019
Install minimal set of dependencies (IIS, .NET Framework, Rewrite Module)
Deploy the published app to IIS
The app did not work at this point. I got a 500.19 with error code 0x8007000d. I got it working by installing the Hosting Bundle. I manually removed a few things that were installed with the hosting bundle, and found that "Microsoft .NET Core 2.1.28 - Windows Server Hosting" is required. I don't know exactly what that is, but it smells to me like the .NET Core runtime is somehow involved here.
Update
When I install the Hosting Bundle, I see a few important things get installed:
C:\Program Files\dotnet\dotnet.exe
C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All\
C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\
C:\Program Files\dotnet\shared\Microsoft.NETCore.App\
When I uninstall the .NET Core Runtime, I am left with just the following:
C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All\
C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\
The app still works at this point. I assume what remains is the ASP.NET Core Runtime, which is different than the .NET Core Runtime. I am just looking to confirm that this app is only dependent on the ASP.NET Core Runtime and .NET Framework, and not at all dependent on .NET Core.
We have a system that has CPU, memory, disk, network card, IO devices, etc. We need a software to manage these resources for us and let us use this system. That software is the kernel. (say Linux)
Now that we can control the hardware we need abstraction on top of it for daily usage for users. We need shell, windowing system, different kind of services and daemons. We call this whole package the Operating System. (say Ubuntu)
Now that we can happily use our computer, we want to write our own applications for our problems or maybe for other's problems. The OS provides us with a programming language and a library of functions and system calls that we can use to create software, just like the OS itself is using them. (say C and glibc)
Suddenly we realize that our software is not portable to other Operating Systems and it has a lot of complex boilerplate codes. So we create a new programming language and provide a new set of library functions but this time way easier to read and understand. (say C# and .NET 5 SDK)
But we have a problem. Our OS does not understand this new language. So we need a layer between our language and the OS. This piece of software must read our program and somehow translate it for the OS. This program is the Runtime. (say .NET 5 Runtime)
OK, let's review. We create an app with C# and .NET. this results in a program that is in the IL language. OS does not understand IL language, therefore we need the .NET runtime to read our IL app and translate it for the OS. But how do we set this up?
We have two options:
We install the .NET runtime on every system that needs to run our app; this way our app becomes portable but it needs the runtime to work.
We include the runtime code inside our app; this way our app does not need the runtime but it won't be portable anymore and since it carries the runtime it will be larger.
Now to clear a few of your confusions:
What is the difference between .NET Framework and .NET Core?
.NET Framework only runs on Windows and has more libraries to use.
.NET Core is cross-platform and has fewer libraries to use but is very fast. It now goes with the name .NET 5 and those extra Windows-only libraries have been added to it.
What is the difference between .NET SDK and Runtime?
SDK provides you with the tools you need to build an app with (SDK includes the Runtime as well).
Runtime is lighter and just runs your app.
What is the difference between .NET Core Runtime and ASP.NET Core Runtime?
.NET Core runtime (.NET 5 runtime now) can only run your console apps and is lighter.
ASP.NET Core runtime can run your web apps.
There are also runtimes for GUI apps capable of running WinForms and WPF apps (Windows-only).
What is MVC?
Model-View-Controller is a design pattern and it is not related to a specific language or framework.

Can I use .NET 4.6 for main domain and .NET Core for api

So I've developed a standard .NET 4.6 CRUD app that adds / edits / deletes data in a SQL Express database and is hosted on Azure. This will only be used by a couple of people to manage data for the main project which will be a one page Angular / mobile app. The next step is to develop an api (with .NET Core) so the data can be consumed by the Angular / mobile app.
What I'm wondering is if I already have the main CRUD app created with .NET 4.6, can I create an api in the same domain using .NET Core? Something like this:
mydomain.com - .NET 4.6
mydomain.com/api - .NET Core
Sure you can do this, you can also run a node.js app on mydomain.com/api_js for that matter, it's all about how do you configure your web server.
If it's a question how to configure the web server, you need just to google about your particular web server.
If it's a question if that makes sense - in my opinion yes, MS is putting now so much effort in being multi-platform, that my bet would be on the .NET Core being more future proof.
Only you have to keep in mind, that it won't be a simple reference adding to reuse the code, as it's not possible to reference .NET 4.x assemblies from a .NET Core project.
But it's possible the other way around, so you can abstract away the code you want to reuse from your .NET 4.6 project into a shared .NET Core assembly, which than may be referenced by both projects.

.NET app doesn't run on WinRT. Justify support for it in .NET 4.5

I read that WinRT does not have a layer that support .NET applications here: seek to 1:55 seconds http://www.youtube.com/watch?v=TI0ABjSKAGU
I also read that .NET 4.5 framework provided support for Windows Runtime here Differences between .NET 4.0 and .NET 4.5 in High level in .NET.
Here is my confusion:
Does that mean that I can run my .NET application on Windows Runtime now? How WinRT supports my .NET app? I have an idea that .NET can only be used to create web applications which are usually consumed using webbrowsers. If WinRT had a browser then why WinRT had problems in running my .NET application?
WinRT is an OS/layer which is installed on ARM based machines and tablets (Surface tablet).
I want to know what type of .NET application I will be developing for WinRT given that I now have support for Windows Runtime in .NET 4.5 framework.
If you are developing an application for the Windows Store, you will be developing it using the Windows Runtime (WinRT). That is the only option today. After you've made that choice, you can choose between a C#/XAML or a HTML/WinJS user interface. You don't "choose" .NET 4.5. You're selecting the Windows Runtime.
There are two distinct platforms, and overlapping terminology:
Windows Runtime (usually abbreviated as WinRT) and .NET
The .NET platform has existed and been available for production development purposes since the release of Visual Studio 2002 and .NET 1.0. Using this platform, and its modern versions (4.5.1 with Visual Studio 2013), you can build what would be considered a traditional Windows executable or application. From Windows Services, desktop applications written for several different UI platforms (WinForms and WPF), and sophisticated web applications all can be created and are portable across all modern versions of Windows, with the exception of WindowsRT. WindowsRT runs traditionally on lower powered ARM processors, and cannot execute a traditional application written for .NET.
Unfortunately, the names and capabilities are very confusing. WinRT (Windows Runtime), which is the platform, can be used to create Windows Store applications. It cannot be used currently to build what would be considered a native desktop application. .NET 4.5 cannot be used to build a Windows Store application. The WinRT platform can target any modern Windows device, from tablet, to desktop. WinRT also runs on Windows RT, which are the lower powered, non-x86 chipsets like ARM.
All platforms share several languages: C#, VB, and C++.
The WinRT's libraries manifest as a layer that look identical to nearly identical in many cases to .NET libraries. In fact, the documentation can often be used for either in common cases. More confusingly, it's sometimes referred to as .NET for Windows Store apps. You'll see how it's not a complete .NET 4.5 implementation.
The confusion often comes from the fact that they are so similar. The underlying code for WinRT is not .NET. It is opaque (and mostly written in C++). It looks like .NET 4.5, and often performs/behaves like .NET 4.5, but it isn't the same platform as is used by a traditional .NET 4.5 application. While you can create code that can run as a portable class library and use functionality and APIs that are common to all platforms (.NET and WinRT), a WinRT application can not directly call .NET 4.5 code.
The Windows Runtime is a highly sandboxed and API-curated developer experience, much like is available on various phone platforms, like the Windows Phone Runtime, iOS, and Android. If you look at the "surface" area of the .NET platform and CLR, you'll see how large and complex it has become, and that there are a lot of capabilities that either don't make sense in the context of a Windows Store application, or simply aren't safe. I expect over several releases Microsoft will include additional features to the Windows Runtime from the core Windows OS. Those APIs may/may not mirror similar functionality found in .NET 4.5.
However, on a Windows 8+ system, a Windows .NET application can access a subset of the APIs available in the WinRT (the marketing folks at Microsoft refer to it as a "streamlined" set of APIs). For example, you cannot access the WinRT UI platform and create a desktop application that builds its interface using WinJS or XAML, which are only available in a WinRT application.
.NET Framework Support for Windows Store Apps and Windows Runtime

Enable .NET 3.5 Features in Azure Cloud Service

I have an application built using .NET Framework 4.5 deployed in Azure Cloud Service. So I use Windows Server 2012 OS Family (supports .NET 4.0 and higher). My application is referencing a tool that can only be run with .NET 3.5 features enabled. So I login into the remote desktop and enable .NET 3.5 features.
I read this article Windows Azure Execution Models stating that "a Cloud Services application shouldn't maintain state in the file system of its own VMs. Unlike VMs created with Windows Azure Virtual Machines, writes made to Cloud Services VMs aren't persistent;"
Do you think my changes in the server (enabling .NET 3.5 features) is not ideal? If yes, can you suggest of a way on how can I deploy a .NET 4.5 web application with .NET 3.5 feature dependency.
Do you think my changes in the server (enabling .NET 3.5 features) is
not ideal?
Yes if you're doing it manually via RDPing into the server. Because if for some reason your VM goes bad and Microsoft replaces that VM with another VM, your changes will be lost.
can you suggest of a way on how can I deploy a .NET 4.5 web
application with .NET 3.5 feature dependency.
Do take a look at Startup Tasks to install additional dependencies. They get executed when your role starts so you could enable the features (or do any software installs before the role starts). I haven't tried enabling the features personally (so I may be wrong) but take a look at this blog post which talks about installing these features through PowerShell or Command Line: http://blogs.msdn.com/b/sql_shep/archive/2012/08/01/windows-2012-and-net-3-5-feature-install.aspx

Connectivity of Winform Applications/ASP.NET application with SAP databases

How can I fetch data in a Winforms application or ASP.NET form from a SAP database? The .NET framework used is 2.0. , language is C# and SAP version is 7.10.
Not sure if this will work for you, but there's a C library, which can probably be used from your C# application and which provides a quite easy API for calling BAPIs in SAP. (Accessing the underlying database directly via SQL is not to be recommended... Better use BAPIs or a custom-tailored RFC-enabled function module.)
See http://service.sap.com/rfc-library
You may also be able to use the "SAP connector for Microsoft .NET" (from the same link above), but it was developed with .NET 1.1 and may have compatibility problems with .NET 2.0?!
Update (2011): Since Dec. 2010 there is a new version of the "SAP connector for Microsoft .NET" available, which works with .NET Frameworks 2.0, 3.5 and 4.0. This would now be the perfect solution for your question! See http://service.sap.com/connectors ---> SAP connector for Microsoft .NET
Apologies for the plug.... I work for ERP-Link, and we have a product, iNet.BPS, which is a VS2005 plug-in that helps you create proxy objects that can be used by your .NET code to call BAPI's on an SAP system. iNet.BPS lets you customize the BAPI method calls, for instance it lets you elide optional parameters your application is not using, thus simplifying your code by not having to pass over a dozen parameters to the BAPI. This product is not dependent on SAP AG's SAP Connector for .NET.
Here's a link to the marketing page, http://www.erp-link.com/html/product/product-overview-iNetBPS_Overview.asp

Resources