Questions tagged [notsupportedexception]

The exception that is thrown when an invoked method is not supported, or when there is an attempt to read, seek, or write to a stream that does not support the invoked functionality.

The exception that is thrown when an invoked method is not supported, or when there is an attempt to read, seek, or write to a stream that does not support the invoked functionality

System.Object
. System.Exception
. . System.SystemException
. . . System.NotSupportedException
. . . . System.PlatformNotSupportedException

NotSupportedException is also thrown by System.IO classes whenever there is an attempt to read, seek, or write to a stream that does not support the invoked functionality.

http://msdn.microsoft.com/en-us/library/system.notsupportedexception(v=vs.110).aspx

123 questions
65
votes
27 answers

Why does NotImplementedException exist?

This really, really urks me, so I hope that someone can give me a reasonable justification for why things are as they are. NotImplementedException. You are pulling my leg, right? No, I'm not going to take the cheap stab at this by saying, "hang on,…
53
votes
1 answer

When to use InvalidOperationException or NotSupportedException?

I am implementing a custom collection implementation that can either be readonly or non-readonly; that is, all the methods that change the collection call a function that is the moral equivalent of: private void ThrowIfReadOnly() { if…
38
votes
5 answers

Automapper 3.0 - This type is not supported on this platform IMapperRegistry

I updated my project to use Automapper 3.0.0 and now my TFS build is not succeeding. The error is the following: "...System.PlatformNotSupportedException: System.PlatformNotSupportedException: This type is not supported on this platform…
nano
  • 439
  • 4
  • 7
36
votes
7 answers

Stream.Length throws NotSupportedException

I am getting a error when attempting stream.Length on a Stream object sent into my WCF method. Unhandled Exception! Error ID: 0 Error Code: Unknown Is Warning: False Type: System.NotSupportedException Stack: at…
Nevin Mathai
  • 2,316
  • 13
  • 39
  • 54
28
votes
2 answers

try-with-resources are not supported at this language level - Android

I have a problem with "try-with-resources are not supported at this language level" in android in the following posted code, I tried to set language to 7 but it stills keeps giving me the same example plus it keeps giving me the option to change to…
this.user3272243
  • 1,166
  • 2
  • 9
  • 24
14
votes
1 answer

TypeError: decoding str is not supported

Im trying to make a attribute characteristic randomiser for my nephews board game and I'm trying to write the attributes to an external file so that he can use them later. when i am trying to write to the file it comes up with the error speedE =…
Lomore
  • 207
  • 2
  • 3
  • 11
13
votes
4 answers

C#, Is there a better way to verify URL formatting than IsWellFormedUriString?

Is there a better/more accurate/stricter method/way to find out if a URL is properly formatted? Using: bool IsGoodUrl = Uri.IsWellFormedUriString(url, UriKind.Absolute); Doesn't catch everything. If I type htttp://www.google.com and run that…
PiZzL3
  • 2,092
  • 4
  • 22
  • 30
11
votes
3 answers

Error: Specified method is not supported?

I keep getting this error when I try to call Find() public void findTxt(string text) { BindingSource src = new BindingSource(); src.DataSource = dataGridView1.DataSource; src.Position = src.Find("p_Name", text); //…
DanSogaard
  • 712
  • 5
  • 13
  • 27
9
votes
3 answers

LINQ Lambda, Group by with list

I'm having some trouble with finding the right syntax to accomplish the following: Is it possible with LINQ (Lambda Expression) to .GroupBy data and instead of using the usual .Sum() or .Count() I want the resulting data to be a List of Int. I…
gerb0n
  • 380
  • 1
  • 5
  • 19
7
votes
2 answers

EF4.1 multiple nested entity Includes gets NotSupportedException?

Edit: Updated problem description based on testing - 12 Sep 2011. I have this query that throws a NotSupportedException ("Specified method is not supported.") whenever I call .ToList(). IQueryable query = db .FileDefinitions …
6
votes
2 answers

NHibernate 3 LINQ inner join issue with three jumps: NotSupportedException

I have a query that used to work in NHibernate LINQ 2.1.2 but it is throwing NotSupportedException with NH3: IQueryable query = from flower in GetSession().Query() from leaf in flower.Stem.Leaves //…
kaptan
  • 3,060
  • 5
  • 34
  • 46
6
votes
2 answers

Create a BitmapImage from a byte array

I am creating a byte array with arbitrary values in it and want to convert it into a BitmapImage. bi = new BitmapImage(); using (MemoryStream stream = new MemoryStream(data)) { try { bi.BeginInit(); …
tabina
  • 1,095
  • 1
  • 14
  • 37
6
votes
1 answer

NHibernate Overcoming NotSupportedException

Does anyone know of any way to overcome NotSupportedException? I have a method against a User: public virtual bool IsAbove(User otherUser) { return HeirarchyString.StartsWith(otherUser.HeirarchyString); } And I want to…
Jordan Wallwork
  • 3,116
  • 2
  • 24
  • 49
5
votes
2 answers

An attempt has been made to Attach or Add an entity that is not new, perhaps having been loaded from another DataContext

I've got a problem with NotSupportedException, I'm getting: "An attempt has been made to Attach or Add an entity that is not new, perhaps having been loaded from another DataContext." partial class SupplyOfert : Model { public SupplyOfert(int id…
kryski
  • 414
  • 2
  • 6
  • 18
4
votes
2 answers

How can I use a local collection with Linq-to-SQL?

I read this question which is the same issue I'm having. Unfortunately, the marked solution didn't help. I'm probably misunderstanding something really obvious about LINQ. I'm trying to do a reverse lookup of sorts. I need to find all courses…
Mark
  • 369
  • 3
  • 11
1
2 3
8 9