Last post Aug 21, 2017 08:37 AM by Edward Z
Aug 19, 2017 06:19 AM|bluMarmalade|LINK
In my 1.1 app I used this method when saving a IFormFile:
foreach (IFormFile source in files)
string navn = ContentDispositionHeaderValue.Parse(source.ContentDisposition).FileName.Trim('"');
var filename = this.EnsureCorrectFilename(navn);
using (FileStream output = System.IO.File.Create(this.GetPathAndFilename(filename)))
It worked perfectly untill I upgraded my app to 2.0. Now the Trim method don't take any arguments. Even If I just use Trim().ToString(); It can't convert to string properly.
What is going on here?
Aug 19, 2017 07:57 AM|bluMarmalade|LINK
I found the answer:
So the old code used the library System.Net.Http.Headers;
When upgrading to 2.0 this somehow got changed to Microsoft.Net.Http.Headers;
Changing the usingstatement on the top to the old version fixed this.
An easy error to make, because the difference is just two words in the libraries, who are very much the same. Inspecting the code definitions I thought they just had changed the
code. But thinking about that it wouldn't make sense as many things would just stop working.
Aug 21, 2017 08:37 AM|Edward Z|LINK
Thanks for sharing the solution, and I would suggest you mark your reply as answer which is the way to close a thread here.