Skip to content
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

Changing CSS in RCL forces app restart when using BlazorWebView #42871

Closed
1 task done
jburman opened this issue Jul 22, 2022 · 10 comments
Closed
1 task done

Changing CSS in RCL forces app restart when using BlazorWebView #42871

jburman opened this issue Jul 22, 2022 · 10 comments
Assignees
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. feature-css-isolation This issue is related to CSS Isolation feature feature-hot-reload This issue is related to the Hot Reload feaature Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update.
Milestone

Comments

@jburman
Copy link

jburman commented Jul 22, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Scenario: Running WinForm app with dotnet watch. App has all Blazor components and resources in a Razor Class Library.

Hot reload works with component changes, but changes to .css files are detected as rude edits and forces the app to restart.

Expected Behavior

Css changes should be hot-reloaded instead of restarting app.

Steps To Reproduce

Create WinForms hybrid blazor app, reference an RCL with .css file and run from command line with dotnet watch.

Exceptions (if any)

No response

.NET Version

6.0.301

Anything else?

No response

@TanayParikh TanayParikh added area-blazor Includes: Blazor, Razor Components feature-css-isolation This issue is related to CSS Isolation feature feature-hot-reload This issue is related to the Hot Reload feaature labels Jul 22, 2022
@javiercn
Copy link
Member

Might be related to dotnet/sdk#26762

@jburman
Copy link
Author

jburman commented Jul 22, 2022

Just to add... this was with a stand alone css file under the wwwroot folder inside the RCL.

@mkArtakMSFT mkArtakMSFT added the bug This issue describes a behavior which is not expected - a bug. label Jul 25, 2022
@mkArtakMSFT mkArtakMSFT added this to the 6.0.x milestone Jul 25, 2022
@TanayParikh
Copy link
Contributor

Related to dotnet/maui#7479?

@javiercn
Copy link
Member

@TanayParikh I am giving this to you since you have more context.

@javiercn javiercn assigned TanayParikh and unassigned javiercn Oct 19, 2022
@TanayParikh
Copy link
Contributor

@jburman can you please confirm if you're still encountering this issue in the latest VS and .NET 7 RC2? If so, please provide information on the exact VS and SDK versions you're using.

@TanayParikh TanayParikh added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Oct 19, 2022
@ghost
Copy link

ghost commented Oct 19, 2022

Hi @jburman. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@jburman
Copy link
Author

jburman commented Oct 20, 2022

TLDR: no changes

Hi, the original issue I reported was with dotnet watch. I am still seeing the same behavior with .net 7 SDK installed, but I did some additional testing...

I just installed VS 17.4.0 Preview 4.0 and have SDK 7.0.100-rc.2.22477.23. I also updated my test project to net7.0-windows.

  • If I run the program with (or without) debugger attached, VS will not allow me to save changes to the CSS file and it thinks that the file is locked. What is strange is that I can edit the css file without any issues outside of VS and VS will hot-reload the CSS into the app.
  • If I run the app with dotnet watch, VS also says that the file is locked and will not save it, but I can still edit the file outside of VS. However, dotnet watch still thinks it's a rude edit and wants to restart the whole app. I primarily do all of my work through dotnet watch.

For what it's worth, I also have VS 17.3.6 Enterprise installed and I rolled the projects back to .net 6 and they behave the same as above.

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Oct 20, 2022
@TanayParikh
Copy link
Contributor

TanayParikh commented Oct 20, 2022

Thanks @jburman. Just to confirm, are you seeing dotnet/maui#9197 by any chance?

I would've expected dotnet/maui#9645 to resolve the Save As issue, and I believe 17.4 Preview 4 should have that. I believe @BillHiebert had mentioned this may be related to some of the file locking issues we've been discussing.

@TanayParikh
Copy link
Contributor

The file lock issues described above are likely a result of https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1659321.

However, dotnet watch still thinks it's a rude edit and wants to restart the whole app.

@BillHiebert thoughts on this?

@TanayParikh
Copy link
Contributor

Closing this out now as there have been many changes in this area and this issue should now be resolved. If you're still experiencing this issue on the latest VS Preview, with the latest SDK, please let us know by either commenting on this issue or creating a new issue should this issue be locked.

@ghost ghost locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. feature-css-isolation This issue is related to CSS Isolation feature feature-hot-reload This issue is related to the Hot Reload feaature Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update.
Projects
None yet
Development

No branches or pull requests

4 participants