-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] VS For Mac 8.9 Preview 4 broke hot reload #13721
Comments
Could you attach a sample where reproduce the issue? |
@jsuarezruiz The only requirement is that the RangeSlider element must have an 'x:Name' attribute for the error to happen. I uploaded a repro project and updated the report to reflect the necessity for the 'x:Name' property to exist for the error to happen. |
I experience a similar issue in my project with some random components: This seems to be a reappearance of #11101 I removed the x:Name attributes in my application but that didn't have any positive result.
|
Could the needs repro tag be removed? |
Still seeing this issue in Visual Studio for Mac 8.9.4 (stable), when using some custom or third-party components. The project builds and deploys fine with such issues - but hot-reload is completely broken.
Show/Hide Visual Studio info
|
Same here. I have to reload Visual Studio if I make edits in case I use components such as the RangeSlider from the Xamarin Community Toolkit. Has hot reload been deprecated? |
Hello? Here is a screenshot of what happens every time an XAML file is changed: RangeSlider is a part of the Xamarin.CommunityToolkit package. Any chance hot reload could be fixed? It is very hard to use the current version of Visual Studio for Mac/Xamarin.Forms as some core features are broken, and all focus seems to be on new versions. We rely on these tools so any chance these could be fixed? Please!! @jsuarezruiz Tagging you, maybe you can help? This still happens with the latest version of VS For Mac and latest version of Xamarin.Forms. Thanks. |
Refresher. What causes the problem: #13721 (comment) |
@Tommigun1980 if you go to preferences -> tools -> hot reload and set hot reload to Full Page, it will work. I've the same errors and hot reload works for me. I do agree that there is a lot of focus on the new version and that it seems to be obstructing bugfixes/releases on production code, which is a bit annoying. Hope it's worth it. |
@Tommigun1980 Could you attach an example where reproduce the issue?, just a Xamarin.Forms project adding a RangeSlider (or any control from the XCT)? |
@jsuarezruiz This bug report does have a repro sample I made four months ago. Other people in this thread have reported that it's not specific to the RangeSlider (#13721 (comment)), but that other third party controls incur the same problem. I have personally only seen it with the RangeSlider as it's the only third party control of the sort I am using, so I can only verify that at least that one breaks hot reload. My repro project is literally just a RangeSlider (with an x:Name attribute as it seems to be required to incur the error). Furthermore, the page that is being reloaded doesn't even need to have a RangeSlider on it. It's enough if it exists anywhere in the project for hot reload to stop working. @jtorvald Thank you for the suggestion, but unfortunately it doesn't help. In fact it introduces a third error when enabling full page refresh ("Object reference not set to an instance of an object", at line -1): |
I've been without hot reload for several months now and have pretty much stopped updating UIs until this is fixed. It is just too slow to iterate on anything without it unfortunately. |
@jsuarezruiz I've these errors as well, also the Expander from XCT. I thought that it was about the x:Name being set. But in this example the Hot reload per item also doesn't work for me without the x:Name. Even with an xct:Expander the hot reload per item does not work if I change the text on the label. That being said; The hot reload per page works for me, also with the example above. @Tommigun1980 are you sure you tested it by stopping the debugging, changing the preference and re-deployed to the simulator? Because if I just change the preference while debugging it does not work. But with a new deploy it does with your sample project. |
@jtorvald In my repro project the error only showed up when x:Name was added to the RangeSlider. You can verify this by downloading it and removing the attribute, at which point hot reload does start to work. I am also using the xct:Expander component in my project, but because it lacks an x:Name attribute it doesn't break hot reload. I am also sure I stopped the simulator after turning on full page refresh, and I even restarted VS For Mac to be sure. After restart I only get the two errors with hot reload, ie the ones where it complains about RangeSlider not being resolved. I have a suspicion this may be related to how the external library is referenced. Xamarin.CommunityToolkit changed their recommendation that it should be referenced via the |
@Tommigun1980 yeah I'm not saying that you're lying ;-) I noticed exactly the same what you wrote above. With the x:Name. That's what I've in my other project as well. I'm currently updating VS and will test this again with your sample project after the restart. I will also try to figure out if it's caused by the url namespace. |
@jtorvald I wasn't implying you were saying that, I just stated what I had been able to verify. Thank you so much for looking into this with me!! Let's get this to work. |
@jsuarezruiz It should probably be mentioned that these errors: If the changes are done while the app is running, though, the same errors prevent hot reload from working. |
I tested it with the most recent (stable) version of visual studio. Results below: Versions:8.10 build 1773 -= XCT with URL namespace =-The above sample solution has an old version. VS also warns that Hot reload needs 5.0.0.2012 to work. Xamarin Forms 5.0.0.1931 x:Name: Without x:Name: -= XCT with URL namespace =-Xamarin Forms 5.0.0.2012 With x:Name: WITHOUT x:Name: (needs clean all and re-open solution) -= XCT WITHOUT URL namespace =-Not possible in XAML? |
@jtorvald Thank you for the testing! So the conclusion is that with the latest XF version (5.0.0.2012) neither full page or changes only work, and that the error goes away if the "x:Name" attribute is removed (once the solution is cleaned and re-opened), right? That is 100% consistent with my findings if I understood it correctly. Great find that you have to restart VS (and possibly delete obj and bin folders) for the changes to take place. @jsuarezruiz As @jtorvald said, my repro project has by now an outdated Xamarin.Forms version so please update it to the latest version before running the repro sample. Also fwiw I have also encountered issues where I have to delete the obj and bin folders before some issues go away. This seems to also only happen with newer versions of VS For Mac. It'd be great if this wasn't required as you never know when it's needed, and it's time consuming to constantly be deleting them just to be sure. As an example I was trying to isolate a regression with a new version of the Microsoft SignalR library so I was jumping between different NuGet versions of its packages, but the changes took place only after deleting bin and obj folders (cleaning solution wasn't enough). The tools are currently regressing at quite a high rate and that's never good. |
@jtorvald @jsuarezruiz @StephaneDelcroix The latter notation makes the problem go away. Could this please be fixed? Microsoft itself recommends to use the broken annotation. Or is this a Xamarin.CommunityToolkit issue and not related to hot reload? |
@Tommigun1980 of course. I didn't find the correct namespace before. With the one you provided, it works. See results below. Please note that I really need to do a full restart of VS and clean bin/obj and clean the solution before I get reproducible results. Otherwise it can still happen that it works (with x:name) or doesn't work (without x:name) based on the previous test case. -= XCT WITHOUT URL namespace =-Xamarin Forms 5.0.0.2012 With x:Name: (needs clean all, remove bin/obj and restart VS) WITHOUT x:Name: (needs clean all, remove bin/obj and restart VS) -- |
@jtorvald Thank you for also verifying this! I really appreciate it. Hopefully the good guys can fix the issue soon. I updated the report with the additional details. |
@Tommigun1980 same results posted in the same minute 🥇 thanks for suggesting the old-skool namespace. That helps me with my projects for the time being. |
This is quite old by now and hopefully fixed in newer versions. If not, please report the issue through the Visual Studio Help menu. That will include all the necessary logs and should make this land with the appropriate team. Thanks! |
Description
Steps to Reproduce
I am not sure whether this report should be a Visual Studio report or a Xamarin.Forms report. Please let me know if this report is filed in an incorrect place!
NOTE!! If instead of using the recommended
xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
notation the "old school" variantxmlns:xct="clr-namespace:Xamarin.CommunityToolkit.UI.Views;assembly=Xamarin.CommunityToolkit"
is used, then the problem goes away.Expected Behavior
The hot reload change should be made visible.
Actual Behavior
Hot-reload compilation fails with:
Basic Information
Environment
Show/Hide Visual Studio info
Build Logs
Reproduction Link
HotReloadBroke.zip
The text was updated successfully, but these errors were encountered: