[EDIT by guardrex to add the metadata]
Issue moved from MicrosoftDocs/feedback#3267
_From @DataJuggler on Friday, November 13, 2020 10:58:17 AM_
I am trying to update my BlazorFileUpload component to .Net 5, and use the FileUpload.razor that was listed here:
https://github.com/dotnet/AspNetCore.Docs/tree/master/aspnetcore/blazor/file-uploads/samples/
I copied the code, and I can get everything to compile after adding some additional using statements, but this one I cannot find.
I don't know how to find the listed InputFileChangeEventArgs file.
Please include instructions for this and how to find it.
Your 'How To Download' instructions are not very helpful as a sample project should be a single clonable project, and I haven't found that.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Issue moved from MicrosoftDocs/feedback#3267
_From @welcome[bot] on Friday, November 13, 2020 10:58:18 AM_
Thank you for creating the issue! One of our team members will get back to you shortly with additional information. If this is a product issue, please close this and contact the particular product's support instead (see https://support.microsoft.com/allproducts for the list of support websites).
Hello @DataJuggler ... If you use the This page feedback button at the bottom of the topic, it will open an issue on this repo.
Your 'How To Download' instructions are not very helpful as a sample project should be a single clonable project, and I haven't found that.
We haven't adopted the MS code samples approach _yet_. It's being considered for this doc set.
InputFileChangeEventArgs
You can find API using the API Browser (the namespace is at the top) ...
We made an update ...
https://github.com/dotnet/AspNetCore.Docs/pull/20046#discussion_r496800293
... but didn't get the namespace at the top.
Leave this issue open. It will close automatically when the PR merges. Thanks for letting us know about this.
That was a partial fix ... I should add all of the namespaces to the example in the topic or cross-link the sample's code into the topic. I'll fix this in the morning.
Thank you. Could you answer an additional question I haven’t been able to answer:
Will I now be able to file upload completely with .Net 5, or do I still have to use .Net Standard in someone way?
Thanks again.
Corby
From: Luke Latham notifications@github.com
Sent: Monday, November 16, 2020 6:03 PM
To: dotnet/AspNetCore.Docs AspNetCore.Docs@noreply.github.com
Cc: Corby Nichols corby@datajuggler.com; Mention mention@noreply.github.com
Subject: Re: [dotnet/AspNetCore.Docs] Sample inputfile code has a reference to something called InputFileChangeEventArgs (#20618)
That was a partial fix ... I should add all of the namespaces to the example in the topic or cross-link the sample's code into the topic. I'll fix this in the morning.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/dotnet/AspNetCore.Docs/issues/20618#issuecomment-728457427, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGI4P7LKWBCT5MGQU6QY3QLSQG4UXANCNFSM4TX2NWNQ.
See: https://docs.microsoft.com/en-us/dotnet/standard/net-standard#net-5-and-net-standard
Both Blazor WASM and Blazor Server ... and the Shared project of a hosted Blazor WASM solution ... all target net5.0 now.
Ok, great! That is what I wanted!
Thanks for your answer.
From: Luke Latham notifications@github.com
Sent: Monday, November 16, 2020 6:15 PM
To: dotnet/AspNetCore.Docs AspNetCore.Docs@noreply.github.com
Cc: Corby Nichols corby@datajuggler.com; Mention mention@noreply.github.com
Subject: Re: [dotnet/AspNetCore.Docs] Sample inputfile code has a reference to something called InputFileChangeEventArgs (#20618)
Both Blazor WASM and Blazor Server ... and the Shared project of a hosted Blazor WASM solution ... all target net5.0 now.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/dotnet/AspNetCore.Docs/issues/20618#issuecomment-728476482, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGI4P7NGCZP2SIMP2CLVRA3SQG6AFANCNFSM4TX2NWNQ.
Your stating that the new template has the namespace in the imports explains why I had the problem.
I tried copying your .razor code into my existing project, which was a .Net 5 project I converted from a .Net Standard project project.
I should have tried a new project, I was just trying to update my Nuget package to .Net 5 and I ran into the problem.
Perhaps a subtopic on your docs something like 'How to upgrade .Net Standard and .Net Core projects to .Net 5' might help others as I am sure I am not the only one upgrading existing projects.
Thanks for explaining to me that I just need to create a new project.
Forms were introduced in 3.1, so the namespace should have been there prior to the move to the net5.0 TFM/.NET 5. However, I'll keep an :ear: open for more feedback and continue to work on the migration topic. One challenge of every release is that we assume the reader is starting with an _immediately prior release_ app, and that just often isn't the case. However, we can't provide guidance that covers arbitrary migration from any prior version to another.
.Net Standard is not that old, and I had to have my code in .Net Standard for some reason I forgot now.
I first learned .Net Standard just a little over 1 year ago when I learned Blazor, so it is not that old. You act like I am upgrading a Web Forms projects by your ‘we only offer guidance on the latest version.’
If I remember correctly File Upload didn’t work in .Net Core, that is why I had to use .Net Standard.
My component is a wrapper of Steve Sanderson’s Blazor File Input, and his project was and still is .Net Standard, so I will not be the only person upgrading from .Net Standard to .Net 5.
Thank you for all your help.
Corby
From: Luke Latham notifications@github.com
Sent: Tuesday, November 17, 2020 7:24 AM
To: dotnet/AspNetCore.Docs AspNetCore.Docs@noreply.github.com
Cc: Corby Nichols corby@datajuggler.com; Mention mention@noreply.github.com
Subject: Re: [dotnet/AspNetCore.Docs] Sample inputfile code has a reference to something called InputFileChangeEventArgs (#20618)
Forms were introduced in 3.1, so the namespace should have been there prior to the move to the net5.0 TFM/.NET 5. However, I'll keep an 👂 open for more feedback and continue to work on the migration topic. One challenge of every release is that we assume the reader is starting with an immediately prior release app, and that just often isn't the case. However, we can't provide guidance that covers arbitrary migration from any prior version to another.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/dotnet/AspNetCore.Docs/issues/20618#issuecomment-728924001, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGI4P7MYMQKIWZHWZNRXGX3SQJ2PBANCNFSM4TX2NWNQ.
I had to have my code in .Net Standard for some reason I forgot now
That was the default for <=3.1. net5.0 is new for .NET 5. In 3.1/netstandard2.1, the namespace was in the default template _Imports.razor file AFAIK/IIRC; however, we don't have it in the prior migration topic. It's one of those small oversights that occurs in the docs that I regret later ... many months later ... but is pointless to sweat at a late date a long time after the release. Although InputFileChangeEventArgs is new for .NET 5, it would come in on the existing namespace if the namespace were present.
I can't speak to Steve's particular example. They (and other experimental and demo samples) aren't in sync with the docs.
The best way to address this with the _Imports.razor file now is to add it to the migration topic. I just recalled that we're missing _another bit_ of churn ... the Microsoft.AspNetCore.Components.Web.Virtualization namespace is required for component virtualization. It's covered where we address the subject, but it's not covered in migration. I'll add it now ... _BUT_ ... to solve this for all types of projects moving to 5.0 (e.g., this will capture the problem with forms and InputFileChangeEventArgs), I'll show the entire file for both WASM and Server. That will solve it in a total way for everyone regardless of upgrade path.
UPDATE: _Done!_ https://docs.microsoft.com/en-us/aspnet/core/migration/31-to-50?view=aspnetcore-5.0&tabs=visual-studio#update-blazor-webassembly-and-blazor-server-projects