Skip to content

UseStaticFiles after update from 2.1 to 2.2 #6660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
KANekT opened this issue Jan 14, 2019 · 6 comments
Closed

UseStaticFiles after update from 2.1 to 2.2 #6660

KANekT opened this issue Jan 14, 2019 · 6 comments
Labels
area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares

Comments

@KANekT
Copy link

KANekT commented Jan 14, 2019

Describe the bug

app.UseStaticFiles(new StaticFileOptions
            {
                FileProvider = new PhysicalFileProvider(
                    Path.Combine(Directory.GetCurrentDirectory(), "Files")),
                RequestPath = "/Files"
            });

project folder is D:\zaochno\new\src\WebSite

in 2.1 files look in
'D:\zaochno\new\src\WebSite\Files'

in 2.2 files look in
'C:\Program Files\IIS Express\Files'

@KANekT
Copy link
Author

KANekT commented Jan 14, 2019

<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>

Solved my problem.

@KANekT
Copy link
Author

KANekT commented Jan 14, 2019

But i have error:
Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request starting HTTP/1.1 GET http://localhost:54905/Files/zachno_mus.mp4 Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request starting HTTP/1.1 GET http://localhost:54905/Files/zachno_mus.mp4 'dotnet.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.2.0\System.Reflection.Metadata.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. Microsoft.AspNetCore.Server.Kestrel:Information: Connection id "0HLJQ0R1UNJ32", Request id "0HLJQ0R1UNJ32:00000001": the application aborted the connection. Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request finished in 119.2638ms 206 video/mp4 An unhandled exception of type 'System.ObjectDisposedException' occurred in System.Private.CoreLib.dll The CancellationTokenSource has been disposed.'

@KANekT
Copy link
Author

KANekT commented Jan 14, 2019

I think this is due to an error: #6150

@jkotalik
Copy link
Contributor

@jkotalik
Copy link
Contributor

The error:

Request finished in 119.2638ms 206 video/mp4 An unhandled exception of type 'System.ObjectDisposedException' occurred in System.Private.CoreLib.dll The CancellationTokenSource has been disposed.'

seems like it is probably coming from your application code. Check the callstack where the exception is thrown.

@jkotalik
Copy link
Contributor

Actually it looks like this issue for the ObjectDisposedException: #4422

@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
@amcasey amcasey added area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares and removed area-runtime labels Jun 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares
Projects
None yet
Development

No branches or pull requests

5 participants