Xamarin.Android - layout designer blank - c#

Today I opened a project to find that none of its layouts will render in the designer.
I am pretty sure it is not an issue with my AXML as the app works fine when built. Visual Studio is up to date (15.9.9) and will display layouts in other projects without issue. My layouts are in the correct location (Resources/layout). I have tried -
Cleaning and rebuilding
Deleting the bin/obj folders manually and rebuilding the project
Turning Accelerated Rendering on/off in Options/Xamarin/Android UI Designer
Opening the project in Visual Studio for Mac (7.8) - same issue
Restarting Visual Studio/rebooting my computer
Any ideas on how to fix this would be greatly appreciated. I am not sure what part of the source would be useful to help with answering this question so please ask and I will provide.
Note - this project is on TFS.

This happened to mine and a colleague's Visual Studio a while ago, it was working then it was blank. We tried changing the target framework but couldn't get it working, I even completely reinstalled VS.
In our cases turning off "Enable Accelerated Rendering" in Tools > Options > Xamarin > Android UI Designer worked and we can now see the app as we build it. We didn't change the setting so assume it's the default, which makes me think it was caused by a VS update.

I have often run into this problem as well. Unfortunately, I have not found an easy fix to this problem other than restarting all instances of Visual Studio (and Android Studio if you have that running as well) followed by a full restart of my computer. Hopefully this help, good luck.

I found that the issue was caused by the target framework version of the app being set to Android 9.0. Setting this to 8.0 to match the version used by the designer fixed the issue.
I need the target framework to be version 9.0 and I can't figure out how to add versions to the designer (8.0 is the only one available to me). I have asked another question in regards to this (see here).

Related

ENC1003 C# Changes made in project will not be applied while the application is running

I am getting this incredibly annoying warning for every C# file in my ASP.NET Core project when I debug it after hitting F5:
Because this error appears only during runtime (not during build), I can't even suppress it using the "Suppress warnings" box in the project properties. I've tried putting 1003 and ENC1003 in there and it still appears, cluttering up my warnings window. Does anyone know why this thing is appearing and how I can get rid of it?
UPDATE: It doesn't fix the fundamental problem which is that the warning is generated in the first place, but I've found a way to suppress it. Create a GlobalSuppressions.cs file at the project root, and add the line:
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(null, "ENC1003")]
Related Github issue: https://github.com/aspnet/AspNetCore/issues/13284
Try to get the Lastest Version of your Visual Studio and try again, If Persist, Install Visual Studio 2019 v16.4 Preview 2.
Also Check out the following content>> https://developercommunity.visualstudio.com/content/problem/601258/edits-were-made-to-the-code-which-cannot-be-applie.html. You can also track this same issue on ASP.NET Github: https://github.com/aspnet/AspNetCore/issues/13284. We already have a fix for it, which will be available on Visual Studio 16.4 Preview 2
I was facing the same problem in my Visual Studio 2019, and therefore I had to update VS to the latest version and I was good to go.
Hope helps someone :) :)
You can go to build options and select the option to build solution (build->build solution), this should solve the problem and you will able to continue your project in solution mode.
I had this problem also in Visual Studio 2022 (17.0.5) running API projects. Restarting Visual Studio helps.
In the past, while debugging UAP apps, if I edit the code while the app is running it will let me know that it needs to recompile the whole application. (Usually when adding some sort of static variable or removing a function etc... Tht in and of itself is not a bug.
The bug is that when I STOP debugging, the error remains until I restart the IDE.
I would argue that suppressing the warning is a horrible idea - It means that you have no way of knowing if the code changes you made during debug were implemented.
Instead, try restarting the IDE and doing a clean and build. I don't remember what I do to make the error go away anymore, as I have not experiences this bug in at least 8 months.

Visual Studio error when I right click UWP project not finding framework

I am having the exact same issue/error as this post from yesterday. Similar SO Post
SIDE NOTE...As you can see, I am new and therefore, only have 45 reputation. As such, I could not simply add a comment to the above existing post and had to create a whole new post even though they are the same issue....seems silly. But I digress....
I wanted to provide additional comments in the hopes to get an answer. My issue started suddenly the a few days ago. I made no major changes to references, VS updates, etc... However, when I right click my csproj in visual studio, I get the error and I have to click it five times before it goes away, at which point I finally get the menu.
Again, I have made no major changes BUT I went ahead and confirmed that:
My target version and Min version is Windows 10(10.0; Build 10586). That is the SDK version that I have installed and am using.
I verified that my NuGet updates are complete and that my Microsoft.NetCore.UniversalWindowsPlatform are installed and update to date (5.2.2 as of now).
I do have a reference also to "Universal Windows". This was created automatically when I created my project and I cannot remove this reference but it is there. When I select it, I do see that it is "UAP,Version=10.0.10586.0" so this should be good. I do notice a possible issue here. Again, this reference was created for me and I cannot remove or change it. However, it is pointed to a folder named
C:\Program Files(x86)\Windows Kits\10\References\Windows.ApplicationModel.Calls.CallsVoipContract\1.0.0.0\
Why did the Windows Universal reference default to that folder and only that folder? I am not using VoIP so I wonder why it chose this one? Also, what if I need some of the other references in the References folder?
I created a brand new Windows Universal project and the same error happens on a fresh project.
Please help, it is annoying. Project still seems to build and work fine though.
Thanks!
I found the issue in my case, it was an extension that I added on to Visual Studio provided by SyncFusion (which their installer actually creates 7 or se extensions in Visual Studio). After troubleshooting my issue and doing some of the same things to resolve (repairing .Net, SDK, Visual Studio) I then thought about the error a bit more. While it is cryptic (and has poor english "An Exception has been occured") these are all clues that it could be any of the frameworks that I have installed via extensions as well.
I also had another clue, the issue started happening a few weeks ago, around the time I updated my SyncFusion controls to the latest version.
So, I went to Tools > Extensions and Updates. I went to Installed > All and found all of the SyncFusion items (there are several) and disabled them all. After I disabled them, and restarted Visual Studio, the problem went away!!!
This is a workaround for now. In the meantime, I put in a support ticket with SyncFusion on the issue. I will certainly update this thread when I get a response from them. Also in the meantime, I then went back and re-enabled each of them again, one at a time, to see who the real culprit was. In my case it was the SyncFusion Web Conversion and Migration extension.
If any of you are not using SyncFusion but having odd Visual Studio issues such as this, I suggest doing something similar by going through your extensions and disable any that you added on, starting with the most recent add ons, especially if they were added around the same time you started having the problem until you find the culprit.
Hope this helps!

Visual Studio 2015 - Can't create Windows 10 app packages for the Windows Store

Since I installed Visual Studio 2015 Update 2 I can't create any app packages for the Windows Store anymore. The apps are linked to the store and compile without any mistakes, however every time I try to create a store package it fails because "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\x86\ilc\Tools\nutc_driver.exe" returns exit code -1073740791. I've already tried both repairing and reinstalling Visual Studio, I've also reinstalled every single Windows 10 SDK package (10240 as well as 10586.212), but none of these attempts fixed my problem. It doesn't even work with a completely new, empty project.
The weird thing is that I can create packages not linked to the store without any problems, the problem only occurs when I try to create the actual store packages.
I'm running the latest stable release of Windows 10 Pro x64 (10586.212) and never tried the Preview SDK or other sorts of pre-release things with these packages. Also, they're all located on my main partition (C:).
The next thing I'd do is to reinstall Windows 10, however that can't be the only option to fix this issue (supposing it would do). So is there anybody who knows what exactly causes Visual Studio to fail at this point?
Thanks!
Edit: The error is also specified as "ILT0005".
So I've figured out what had caused Visual Studio to fail. Believe it or not - the display language of Visual Studio was the problem. I changed the language from German into English and everything worked just fine afterwards.
However, thanks anyway. And maybe I can reach and help some other people who are struggling with the same bug.

Visual Studio 2013 or 2015 EditorPackage did not load correctly constantly

When starting Visual Studio 2013 Pro (Update 4 installed) I very often get this error message (several times a day now) for the past about two weeks:
The 'Microsoft.VisualStudio.Editor.Implementation.EditorPackage' package did not load correctly.
I know I can correct this problem by closing Visual Studio and deleting:
%LocalAppData%\Microsoft\VisualStudio\12.0\ComponentModelCache
I have never seen it before that time and as far as I found out in the Internet it was possibly introduced with Update 3.
Well, the problem is that it is annoying to restart Visual Studio several times a day, and I was wondering if anyone else is experiencing this and knows how to solve it for good or what the cause is.
I noticed that it happens extremely often if I work in more than one instance of Visual Studio in parallel. This one is a killer. But still I suspect a third-party component to be involved or it is the size of one of the solutions (about 70 projects). I tried to deactivate some extensions I newly installed and need for the big project, but to no avail.
Just as information: I am working with C#. When working in parallel with projects open in several instances of Visual Studio I never had problems before.
Does anyone have the same problem to this extend or possibly have a better solution than deleting the folder and restarting?
This has become a popular question so I thought I add an explicit answer how to (at least) temporarily fix the problem as already stated in the question:
I stop Visual Studio and delete the following folder (completely, not just contents)
%LocalAppData%\Microsoft\VisualStudio\12.0\ComponentModelCache
If you are using VS2015, then the path should be:
%LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache
If you are using VS2017, then the path should be:
%LocalAppData%\Microsoft\VisualStudio\15.0\ComponentModelCache
I don't keep a backup of the folder. It is created automatically again when starting Visual Studio.
I have never found a solution how to permanently fix the problem in that working environment. In my new developing environment (new projects and new workplace) the problem never happens.
This is what helped me... seemed to happen after Windows Server 2012 SP install...
https://connect.microsoft.com/VisualStudio/feedback/details/1123745/setsite-failed-for-package-microsoft-visualstudio-editor-implementation-editorpackage
devenv /clearcache
devenv /updateconfiguration
In that case you can start Visual Studio setup again and choose the option showing two options, Repair and Uninstall. Then click Repair and when repair is done, restart the computer. Then the issue has been resolved.

Strange crash of the visual studio 2010

I've accidentally broken visual studio:
I have two different versions: VS express and ultimate.
I installed an add-on a month ago, and were working for some project.
Now I working for same project almost two weeks, and it's now acting strange.
After some writing I tried to debug it, it was successfully built, but after launch VS crashed.
Here is a list of things I've tried:
Safe mode - works
Reseting to default - not work
Reinstalling - not work
Try in express - works
Google doesn't help me. I'm writing an c# console app and I don't have any idea what the problem is.
If anyone knows where is the problem or has experienced something similar, please help me (:
P.S. Sorry my bad english
If safe mode works then I'd say its probably the addon's fault... I'd remove the addon.
Problem was with achivments extensions. When the add tryes to generate achivement by going to one of the lines, it makes the addon crushes all VS. and i learned that addons not deleting by deliting the VS studio. Thanks for all, who tryed to help (:

Categories

Resources