obsolete

Windows 8.1 How to fix this obsolete code?

£可爱£侵袭症+ 提交于 2019-12-06 21:51:57
问题 I have upgraded my project to windows 8.1 from windows 8.0 and got some warnings of obsolete codes. Some of them I have fixed, and some of them not. Here is an image of the last warnings that I couldn't fix and couldn't find any information. All warnings refers to the same method, and it says that it is obsolete, what should I do to get the not obsolete code? Here are the codes: warning number 2. /// <summary> /// Translates <see cref="ApplicationViewState" /> values into strings for visual

The meaning of obsolete

牧云@^-^@ 提交于 2019-12-05 12:14:45
I've taken over a project with a lot of legacy code, both C++ and C#, currently compiling under VS 2010 (on windows 7). When I built my solution, amazingly, 143 projects built successfully. However, there were a boat load of warnings. A surprising number of them were warning about obsolete functions. 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

How can I replace Marshal.SizeOf(Object) with Marshal.SizeOf<T>()?

徘徊边缘 提交于 2019-12-05 08:12:10
I am building a Universal class library from existing code, and I get some compiler warnings that I for the life of it cannot figure out what to do with. I have code like this: void SomeMethod(Object data) { var size = Marshal.SizeOf(data); ... } The code builds, but in the Universal project (and, I guess, .NET 4.5.1 and higher projects) I get the following compiler warning: warning CS0618: 'System.Runtime.InteropServices.Marshal.SizeOf(object)' is obsolete: 'SizeOf(Object) may be unavailable in future releases. Instead, use SizeOf<T>(). But how do I create a replacement for Marshal.SizeOf

Windows 8.1 How to fix this obsolete code?

半世苍凉 提交于 2019-12-05 02:44:14
I have upgraded my project to windows 8.1 from windows 8.0 and got some warnings of obsolete codes. Some of them I have fixed, and some of them not. Here is an image of the last warnings that I couldn't fix and couldn't find any information. All warnings refers to the same method, and it says that it is obsolete, what should I do to get the not obsolete code? Here are the codes: warning number 2. /// <summary> /// Translates <see cref="ApplicationViewState" /> values into strings for visual state /// management within the page. The default implementation uses the names of enum values. ///

How can you mark code as “not for future use”

自古美人都是妖i 提交于 2019-12-05 02:19:55
I often end up in a situation where I want to discourage other developers from continuing to use a method or class. For example, let's say I have two library methods "A" and "B" where "A" is the "old" way of doing some task and "B" is the "new" way of doing that task. In many cases, A and B are sufficiently different to make refactoring code using A to start using B non-trivial (e. g. requires flowing through of additional state). Since A works in the cases where it's used, I don't want to prioritize the refactor. I do, however, want to give my fellow developers a visual indication that A is

Why are drand48() and friends obsolete?

£可爱£侵袭症+ 提交于 2019-12-01 03:36:49
After all, they seem superior to the standard libc rand(). Have I missed something? (I have spent some time searching for this online, and the only other instance of this question I could find was in the context of distribution bias and left unanswered.) The manual pages for rand() and drand48() also seem at odds. The first recommends the second, and the second states that it is obsolete and the first should be used. (Though, to be fair, a lot of people who understand the math behind PRNGs have issues with the man pages for these functions because they are poorly-worded and in some instances

Does ASP.NET Core still use OWIN?

*爱你&永不变心* 提交于 2019-11-30 09:06:10
I noticed when using C# to build an older MVC project, that there is a lot of references to an OWIN library. But when creating a .NET Core web application in VS2015 SP3, seems there's no reference to it. Is this library obsoleted? OWIN is not a library, it's a specification . From the docs, OWIN defines a standard interface between .NET web servers and web applications. The "big idea" of OWIN is that you can decouple applications from the servers they run on, if everyone can agree on a common interface to use. In practice, an OWIN-compatible server can run any OWIN-compatible application. This

why is Android API level 9 obsolete?

我是研究僧i 提交于 2019-11-30 08:23:48
问题 Android version 2.3 - 2.3.2 (API 9) are declared as obsolete, and according to Android Market statistics, are very rare (0.5% of market users). The question is: Why is API 9 declared obsolete and more importantly, is there any reason why should I not use it? I've been using API 9 and see no problems with it... am I missing something? Better not fix it if it's not broken, right? EDIT: Clarification: If I would update my applications' API from 9 to 10, what would be the benefits? I can only see

Usage of the Obsolete attribute

时光总嘲笑我的痴心妄想 提交于 2019-11-30 08:05:20
I was recently told it was bad practice to haved marked a number of methods in our code with the [Obsolete] attribute. These methods were internal to our codebase, rather than being on an API. The methods handled an older encryption function. I felt it was a quick and safe way to denote to the rest of the team that these methods should not be used, and provided a message to suggest alternatives. Others felt that I should have removed the methods entirely, rewriting or refactoring existing code as required. Additionally, it was thought too easy to overlook the compiler warnings. Is there a

If <a name=“…”> is obsolete, what is preferred?

被刻印的时光 ゝ 提交于 2019-11-29 15:59:28
问题 The HTML code <a name="some_bookmark">text</a> is very useful for creating links to specific sections of a page (e.g., page.html#some_bookmark ). However, the W3C spec now marks the name attribute of the a tag as "obsolete." If this is the case, then what is preferred? Is there a new <bookmark> tag or similar? 回答1: You can place an id="" attribute on any element and it will have the same effect. These are typically placed on heading elements. 回答2: Have a look at the HTML5 spec. At Obsolete