VirtualPathProvider not called for file

I got VirtualPathProviderwhich I register using HostingEnvironment.RegisterVirtualPathProvider(new MyVirtualPathProvider())in global.asax.

The method FileExistsis called for mine screen.jsand returns true, but the method is GetFilenever called. Why is he checking the file but not trying to use it?

How can i fix this?

+3
source share
1 answer

The actual logic used is that the file exists, then IIS should be able to serve it directly, and ASP.NET does not need to do anything. If the file extension is .aspx, IIS will then pass it back to ASP.NET and GetFile will be called.

, asp.net .js - , , , , URL- , , .

+1

Source: https://habr.com/ru/post/1780868/


All Articles