Meaning obsolete

I took on a project with a lot of legacy code, both C ++ and C #, which is currently compiling under VS 2010 (on Windows 7).

When I built my solution, surprisingly, 143 projects were successfully built. However, there was a load on the boat warnings. An amazing number of them warned of obsolete features.

warning CS0618: 'System.Runtime.InteropServices.UCOMIMoniker' is obsolete
warning CS0618: 'System.Runtime.InteropServices.UCOMIEnumMoniker' is obsolete
warning CS0618: 'System.Runtime.InteropServices.UCOMIRunningObjectTable' is obsolete
warning CS0618: 'System.Runtime.InteropServices.UCOMIRunningObjectTable' is obsolete
warning CS0618: 'System.Runtime.InteropServices.UCOMIBindCtx' is obsolete
warning CS0618: 'System.IO.Path.InvalidPathChars' is obsolete
warning CS0618: 'System.Configuration.ConfigurationSettings.AppSettings' is obsolete
warning CS0618: 'System.Net.Dns.GetHostByName(string)' is obsolete

What is meant by this? Functions are explicitly defined or they will not compile or will give me some kind of “not found” or “not defined” error. Have the implementations gone? Do these functions perform (as before)?

I looked a few, and they have long been out of date. For example, GetHostByName:

.NET Framework

Supported in: 1.1
Obsolete (compiler warning) in 4.6
Obsolete (compiler warning) in 4.6
Obsolete (compiler warning) in 4.5
Obsolete (compiler warning) in 4.5.1
Obsolete (compiler warning) in 4.5.2
Obsolete (compiler warning) in 4
Obsolete (compiler warning) in 3.5
Obsolete (compiler warning) in 3.5 SP1
Obsolete (compiler warning) in 3.0
Obsolete (compiler warning) in 3.0 SP1
Obsolete (compiler warning) in 3.0 SP2
Obsolete (compiler warning) in 2.0
Obsolete (compiler warning) in 2.0 SP1
Obsolete (compiler warning) in 2.0 SP2

, 8-9 (.NET 2.0 2006 ). ? ? GetHostByName, GetHostEntry. ... , , , , , , GetHostAddresses. , .

, 28 . , , -. , ? , ? , (MSDN)?

, , (, MSDN). , , . ? MSDN , " ".

+4
3

, . , Microsoft , .

+8

"OBSOLETE" , /// , , , . : PHP mysql_query().

+2

I would agree with all the answers above. What I suggest at the top of this is that when the compiler complains about the deprecated method, it is an alarm that needs to be replaced and replace it with the alternative approach provided in the SDK. If you do not plan to upgrade your project to a newer .NET platform, then it’s good for you to live with this warning for life.

0
source

Source: https://habr.com/ru/post/1583847/


All Articles