Questions tagged [obsolete]

Methods and ideas that are no longer used in the current versions of various technologies.

190 questions
6
votes
2 answers

Obsolete member field with property accessor (Visual Studio bug)

I have a class with a member that I need to keep for legacy code and I need to mark it as obsolete so that new code doesn't use it (without getting a warning). Let's say the class looks like this: class MyClass { [Obsolete] private string…
Mårten Wikström
  • 11,074
  • 5
  • 47
  • 87
6
votes
1 answer

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

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); …
Anders Gustafsson
  • 15,837
  • 8
  • 56
  • 114
5
votes
1 answer

AzureADDefaults is obsolete

I have following code for Azure AD authentication: services .AddAuthorization(options => { options.AddPolicy(name, builder => { builder …
user3126358
  • 451
  • 7
  • 9
5
votes
2 answers

Configure autofac to ignore constructors marked as obsolete

Is it possible to easily configure autofac so it will only resolve using non-obsolete constructors? eg for a class with a helper constructor for non-DI code, public class Example { public Example(MyService service) { // ... } …
Nick Sonneveld
  • 3,356
  • 6
  • 39
  • 48
5
votes
2 answers

XmlReaderSettings.Schemas.Add() : The URI prefix is not recognized

I upgraded my old application in .Net 4.5. There are some obsolete methods warnings I was getting so thought to resolve them. One of the obsolete methods is XmlValidatingReader. Looked up on the internet and found that XmlReaderSettings is a…
Dinav Ahire
  • 581
  • 1
  • 10
  • 30
5
votes
1 answer

How do I implement an interface with an obsolete method in VB.NET without suppressing warnings?

I have an interface I, and I have just decided to deprecate method OldMethod (because it's badly named, because I want additional parameters, you name it) and advise users of my library to use NewMethod instead. Thus, I have extended I as…
Heinzi
  • 167,459
  • 57
  • 363
  • 519
5
votes
1 answer

Application Insights Behind a Firewall

I'm having issues getting application insights to report data to Visual Studio Online from behind our firewall. I opened the firewall rules noted in this article but it didn't make a difference. I've uninstalled and reinstalled several times. The…
5
votes
1 answer

How to solve "The border attribute is obsolete. Consider specifying img { border: 0; } in CSS instead"

I am using an image in my website and the html code for this is as follows, Product-Shot.co.uk When I try to validate my page using w3 validation, it gives me the…
Asad Shakil
  • 123
  • 2
  • 11
5
votes
1 answer

What would "POSIX.1-2008 marks ftw() as obsolete" consequently mean?

Reading man 3 ftw I observe that "POSIX.1-2008 marks ftw() as obsolete". Now I am concerned and want to be a "nice programmer" and maybe respect obsoleteness of ftw(). Still I struggle now with finding out what else I should use that is now…
humanityANDpeace
  • 4,350
  • 3
  • 37
  • 63
5
votes
3 answers

What is my obsolete Facebook API call?

I recently got a notice that I'm using one or more obsolete calls which will impact the website shortly. The problem is that I can't find any useful documentation to determine which call is obsolete and every call that I'm making seems to still be…
4
votes
2 answers

MonoTouch: UIImage.asJPEG needs a NSError object

To save a UIImage to a PNG or JPEG locally you call the asPNG().Save(...) function. The asPNG().Save() function requires an out NSError The problem is that you can no longer just create a blank NSError to pass in like this (Obsolete) NSError err =…
Ian Vink
  • 66,960
  • 104
  • 341
  • 555
4
votes
1 answer

How can I mark a type or member obsolete in an assembly that I do not control?

Example: My colleagues are supposed not to use Microsoft.VisualBasic.Collection anymore, and I'd like the build process to should point them to the replacement type. This sounds like a case for the ObsoleteAttribute, except that I can't set…
Nordic Mainframe
  • 28,058
  • 10
  • 66
  • 83
4
votes
2 answers

Why was Pathname's chdir method obsoleted?

Why is Pathname's chdir method obsoleted since ruby 1.8.1? What is wrong with it? This: dir = Pathname('a') dir.chdir do ... end is shorter and more readable than this: dir = Pathname('a') Dir.chdir(dir) do ... end
tig
  • 25,841
  • 10
  • 64
  • 96
4
votes
3 answers

The meaning of obsolete

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…
LawfulEvil
  • 2,267
  • 24
  • 46
4
votes
5 answers

Ambiguous class name

If have a new project (ProjNew ) where I want to put several classes that are on other project (ProjOld). The problem is I want to maintain the old classes marked with Obsolete to avoid running all my projects and check if they using it. But in that…
Pedro Dias
  • 41
  • 2