RickStrahl / Westwind.AspnetCore.LiveReload

ASP.NET Core Live Reload Middleware that monitors file changes in your project and automatically reloads the browser's active page
Other
469 stars 42 forks source link

Costume LiveReloadScriptUrl not using local js file #62

Open gsipic opened 3 months ago

gsipic commented 3 months ago

Hi, there is problem when we use costume url link for config LiveReloadScriptUrl.

Problem is with this code :

if (string.IsNullOrEmpty(_ClientScriptString))
            {
                // Load `/LiveReloadClientScript.js from resource stream
                lock (_ClientScriptString)
                {
                    if (string.IsNullOrEmpty(_ClientScriptString))
                    {
                        using (var scriptStream = Assembly.GetExecutingAssembly()
                            .GetManifestResourceStream("Westwind.AspNetCore.LiveReload.LiveReloadClientScript.js"))
                        {
                            if (scriptStream == null)
                                throw new InvalidDataException("Unable to load LiveReloadClientScript.js Resource");

                            var buffer = new byte[scriptStream.Length];
                            scriptStream.Read(buffer, 0, buffer.Length);
                            _ClientScriptString = System.Text.Encoding.UTF8.GetString(buffer);
                        }
                    }
                }
            }

Its always using internal Westwind.AspNetCore.LiveReload.LiveReloadClientScript.js