Unable to open axml with design view with Visual Studio 2015 - xamarin

I created a new android layout file using visual studio 2015 and am unable to view with the designer that is built in to visual studio.
After selecting 'design' tab, I just see a waiting icon in the center of the view and it never finishes. After a while, i have to close the design tab and open in xml editor. The form is valid as it runs fine in emulator.
ideas?

I was able to resolve after uninstalling all platforms using Android SDK Manager and re-installing each platform 1 by 1. If there is an issue with the installation nothing will be installed (note: watch the logs for errors and review after each platform is installed)
Initially, I did have to manually download SDK Manager and copy the tools folder to my existing installation. I am not sure why my Tools folder was empty but after performing this step I could again run SDK Manager.

Related

Cannot find UnityEngine.InputSystem

I am currently working on a new unity project and to be honest i am new at this.
I need to use the InputSystem package but Visual studio does not recognize it.
This is the version of my VS. Microsoft Visual Studio Community 2019 Version 16.9.3 and the version of Unity is 2020.2.1
As you can see by the picture, my VS already knows that I am working in a Unity project.
So the first thing that I tried doing is to regenerate project files but it didnt work. I also selected my VS as my default external script editor.
This is my external tools.
I re-installed VS using unity hub but nothing happend.
Do you have any suggestions? I followed some tutorials I saw over the internet but I am still getting no positive results and to be honest, I am getting out of ideas.
Just tested out the package installation. I installed the package in a fresh, empty Unity project. Here are the steps that I went through which worked in my case:
Locate the Input System package in the Package Manager
Click install
A warning prompt will appear, click yes
Unity Editor should now get re-launched on it's own, wait for that to happen
If Visual Studio is open, close it
Open Visual studio - right click on the Assets folder and select Open C# project
UnityEngine.InputSystem namespace should now be available, if not, re-open Visual Studio one more time
Let me know if it works for you.
For me works when I install .NET and .NET Core and reboot the computer. (made this on Windows)
https://dotnet.microsoft.com/en-us/download
https://dotnet.microsoft.com/en-us/download/dotnet/3.1

Visual Studio For Mac Designer Error

I have downloaded VS For Mac Preview and created a new Xamarin Forms IOS/Android Solution using the portable library. When i try and load the XAML designer though to view the startup page I get the error "Invalid XAML : default constructor not found for Xamarin.Forms.Applicaton". I have not made any changes to the project code generated by VS For Mac and the only thing I did was to build the Android project as this is required before the designer can be opened. I also had to download the latest versions of the Android SDK via the SDK Manager.
Does anyone have any idea what is wrong
Thanks
Steve
Firstly, there are two preview modes, one for iOS and one for Android - if you can't see both tabs, drag the frame over a bit. I can't currently get the Android preview to work right even though it builds, but for iOS to work it looks like you simply need to update the Xamarin.Forms package. Go to the 'Project' menu and select 'Update NuGet Packages.' Then, restart Visual Studio for Mac and it should be working. It is very slow to load, however. I had to rebuild my project and select 'Update NuGet Packages' a second time before it actually showed up.
I'm still trying to figure out why Android preview does not work.

Xamarin, Visual Studio 2015 - AXML Designer loading forever

I try to edit an axml file in Visual Studio, because drag and drop doesn't work in Xamarin Studio. But when I open my axml file, it's loading forever.
I've been waiting for more than 10 minutes, but it is still loading. When I restart VS I can open the axml file without any problems.
The same applies for all my other axml files (in other projects).
Does anyone knows how to fix this?
I'm using the newest stable version(cycle 8) of Xamarin btw.
EDIT:
I'm using Visual Studio Community 2015 Version 14.0.25425.01 Update 3 and I've got all the latest updates installed.
More detailed explanation:
I open my project in Visual Studio
I open my foo_bar.axml file
I switch from the Designer tab to the Source tab
I remove the android:background="blablabla" attribute
I switch from the Source tab to the Designer tab
The Designer tab is loading forever
AND
I open my project in Visual Studio
I open my foo_bar.axml file
I make some changes
I close the foo_bar.axml file
I reopen the foo_bar.axml file
the foo_bar.axml file is loading forever
NOTE:
The problem doesn't happen when I change the android:text="blablabla" attribute at step 4 and when I change some other attributes it also doesn't happen, so it is specific to just some attributes.
According to a forumer at Xamarin Forums, it has something to do with Cycle 8's AXML Designer not being able to render using the newest API.
But even in Cycle 8 when I choose to compile under Android 6.0 instead of 7.0 in the project's properties, the designer is still wonky as it is. Switch between "Designer" and "Source" on one .axml file and the designer still loads until Harambe cometh.
Therefore, your best bet is to downgrade Xamarin Studio to Cycle 7, and you can finally get the AXML Designer as working as before.
Until Cycle 9 or an incremental update/hotfix of Cycle 8 comes about, this is the way to go for now.
You can download and install the previous cycle in the link below:
https://store.xamarin.com/account/my/subscription/downloads#cycle7
For your own interest, you can read more about the aforementioned forum thread below:
https://forums.xamarin.com/discussion/77992/axml-layout-designer-inside-visual-studio-keeps-loading-forever
This happened to me also. Then I realised I hadn't opened Visual Studio in Admin mode. After I did, everything was fine.
Open the visual studio as admin and it loads perfectly. All the best.

Xamarin - Can't create and run a blank cross platform application

I am new to Xamarin. I have just installed Visual Studio 2015 with Xamarin
and now I am trying to build a new blank cross platform app.
When I build it, it builds successfully. However, when I try to run it in the emulator, it launches but I can't see any output on the screen. It also takes a long time to launch.
Has anyone faced this issue too?
Maybe try Visual Studio Emulator for Android or
Xamarin Android Player.
when you create a new project, try updating Xamarin.Forms and other library in NuGet.
1) Verify in the portable and android project right click in Manage Nuget Package if you have installed the Xamarin.Form
2) Control Panel -> Program and Features -> Visual Studio 2015 doble click and press the button Modify. verify that you updated the installation of Visual Studio.
3) Open the visual studio. Tools -> Options -> Xamarin -> Others. press the link (Check Now) for updates of the xamarin.
4)Open the SDK Manager and verify that you have installed the API 19
5) and finally try to clean the solution and rebuild the project. And run. If this doesn't work.
6) watch the error in the output of the visual studio, if exist any error, or you need some library you watch in this section.

set property 'system.windows.resourcedictionary.deferrablecontent' threw an exception

I'm running Visual Studio 2012, when I add a new File/Reference to a project the message box appears showing the error message
set property 'system.windows.resourcedictionary.deferrablecontent' threw an exception
I read an MSDN article suggesting to run the command devenv /resetuserdata on visual studio command prompt to resolve this problem, tried it but didn't work for me. In fact the command prompt shows the Unknown Error message.
Some addins cause this issue for me so have had to workaround it whenever it occurs:
In Vis studio -
Tools > Options > Environment > Add-in Security, uncheck 'Allow Add-in components to load', OK
Restart vis studio
The error shouldn't occur anymore, so go back to
Tools > Options > Environment > Add-in Security and re-check Allow Add-in components to load, OK
To be specific, I get this error when trying to add files to projects and manage Nuget Packages.
Update
I now make a point of opening
'Tools > Nuget package manager > Manage nuget packages for solution'
whenever I open up a new instance of Vis studio, before loading a solution, just to make sure the window loads properly
That way I know I won't get this issue.
In my case it was a style with the same key defined twice in a ResourceDictionary (WPF)
I have Windows azure tools for Microsoft VisulStudio 2013- v2.2 and Windows azure tools for Microsoft lightswitch VisulStudio 2013- v2.2.
I uninstall only Windows azure tools for microsoft lightswitch vs 2013 .
It's working fine...
I fixed it. The resolution was to remove the Windows Azure Tools for Visual Studio 2012 which I was not actually using, and the error went straight away.
In my case it was to first launch Visual Studio in safe mode. You can create a shortcut for visual studio with a target like this:
'"F:\Program Files\Visual Studio\VS2013\Common7\IDE\devenv.exe" -safemode'
Once launched in safe mode, you can remove the problematic extension via the Addin Manager. However, this wont work for some extensions, as the uninstall option might be disabled for certain extensions when running in safe mode, particularly if you have already uninstalled another extension in the same session.
In My case the problem was caused by Paradox Game engine, in which I had uninstalled it via 'Programs and Features' - which in return did not remove the extension which was originally installed via Nuget package. Uninstalling Paradox via "Programs And Features" left the extension itself still registered in Visual Studio, presumably causing a hidden NullReferenceException.
This issue can be caused by any extension that may have an error in it, or by extensions that were not properly uninstalled.
Also, see this article...
The mentioned issue can be resolved by simply restart the Visual Studio. :P
Also seem to be able to get around this by closing the project and vis studio instance, re-opening, then when the start page/open project screen appears selecting Tools > Extensions and Updates..., then pressing Close
Now open the project and the error doesn't get thrown when trying add files or manage nuget packages, weird.
Just annoying you have to remember to open Extensions and Updates each time...
Other wise make sure given Resourcedictionary.xaml path is correct or not
I had to remove Xamarin from Add/Remove Programs in Control panel and restart Visual studio to fix this.
I had this problem with My Devexpress Project in VS 2015
What finally worked for me was.
Close my solution,
Close Visual Studio,
Open Visual Studio,
Create a New dummy project,
Add a form to it,
Close and save the new project,
Reopen original project and all was ok.
for everyone else who are working in silverlight sdk environment with windows phone8 sdk.
The versions of sliverlight which are compatible with visual studio versions -
vs2012- sliverlight sdk 4
vs2013- silverlight sdk 5
I was integrating in vs2013 and as soon as I updated it with silverlight sdk 5, The errors went away.
In my case it was the Line Endings: you can have different formatting and by copy pasting some code one file got a different Line Ending. It was enough to File > Save As and then click the little arrow next to the save button.
Then click on save with encoding and choose the one you are using in all other files.
See Andrew Truckle's answer.
I hope this helps

Resources