System.ObjectModel Warning Xamarin does not run on Android - c#

We are running the 'Welcome to Xamarin` example on Visual Studio Enterprise, using the latest Xamarin, in a Windows 8.1 environment.
We are managing to build and run on both Windows and Apple, but we are facing problems with Android.
Error:
The referenced component System.ObjectModel could not be found.
The errors can be seen in the screen shot below:
See screenshot
We've already tried searching online for solutions, we found some, which we tried, but to no avail.
On the other hand, is Xamarin compatible with Windows 8.1? Perhaps some Android requirement actually needs a Windows 10 environment.
Any help would be appreciated.

Right click on your Android project's references and manually add the reference: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\System.ObjectModel.dll. And technically that's a warning, not an error.

I simply removed the reference entirely since none of my code actually used it.

In the Package manager console type: (Select the Android project)
update-package -reinstall
Is slower but is the correct method and always works

Exercise 1 from GitHub https://github.com/XamarinUniversity/XAM135/
when opening has the same problem.
Based on the above solutions I resolved by performing the following steps:
Update the Nuget Package
Save, close and abire the solution
Click on the Portable (shared) project-> Referencias-> Donet in the copy properties of the path = "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.5\Profile\Profile111"
Open Windows Explorer and paste the path = "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.5\Profile\Profile111", here is the System.ObjectModel.dll file
Click on the Droid Project -> Referencias and REMOVE System.ObjectModel
Right click on References and Add references
Click the Browse button and open the path = "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.5\Profile\Profile111"
Select System.ObjectModel.dll, and then click Add and OK
The reference was added successfully! Save, compile the project.
Here is a similiar solution

Try moving it to desktop, then add it as ref in solution. worked for me, visual studio had access to all the other ref but for some reason dident have access to that specific ref. So i moved it, and i think it gave visual studio access. simply try to move it where access wont be a problem.

Copy dll and paste to packages folder. Change reference to new location and run project. Of course it's temporary solution. You can check another location for path without white spaces in folders name.
ovee

yes, you are partially correct, it works, but after again giving to old location (C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\System.ObjectModel.dll) missing error resolved.

Related

Upgrade to 2019.2.13 causes Namespace name `EventSystems' could not be found

I have upgraded from 2018.3.14f to 2019.2.13 and I started having really strange errors.
I am now having those two errors:
The type or namespace name EventSystems' does not exist in the namespaceUnityEngine'. Are you missing an assembly reference?
and
The type or namespace name UI' does not exist in the namespaceUnityEngine'. Are you missing an assembly reference?
This is happening only to the project which I upgraded from 2018.3.14 to 2019.2.13.
If I create a new blank project with 2019 there is no issue. The namespaces are found plus when I go to New2019Project/Library/ScriptAssemblies/ I can see the following files:
Then If I go to my upgraded old project in this dir OldUpgradedTo2019Project/Library/ScriptAssemblies/ the folder is having only those files:
As you can see I don't have those files in my updated project. If I try to copy the ones from the new working one into my old upgraded, at the time I start the Unity for the upgraded old project it deletes them and the problem stays.
Is there any way I can fix this annoying problem?
What fixed this issue for me was to update to the latest 'Visual Studio Code Editor' in the Unity Package Manager. To do this, go to window -> package manager -> set 'All Packages' to 'In Project', select the Visual Studio Code Editor and update.
I was experiencing the same issue, but my problem was that I had multiple Google.VersionHandler.dll files in separate folders within Assets. As a result, the .asmdef files were not loading. Here's how I fixed it:
Close Unity and Visual Studio
Remove the extra copy of Google.VersionHandler.dll
Delete all .csproj and .sln files
Delete Library, obj, and Temp directories
Reopen Unity
Click Assets > Open C# Project to regenerate .csproj and .sln files
Hope this works for you!
I update my Visual Studio 2017 to Visual Studio 2019, then everything works.
Hope this works for you.

Visual studio 2017 load project failed

Yesterday, I have finished working on my Android project (c# and Xamarin) on Visual Studio 2017, I closed it. Today, I re-opened the project in order to continue my work but the project is not loading, plus, I am getting an error in the output window saying:
There is a missing project subtype.
Subtype: '{EFBA0AD7-5A72-4C68-AF49-83D382785DCF}' is unsupported by this installation.
I have searched up and tried every solution online but nothing worked for me. I tried to delete .suo file, repairing vs.. I do not know what to do.. please help me to solve my problem.
Here's a screenshot of the error
UPDATE
I enabled Xamarin for Visual Studio, now the error in the output window is (and the project is still failing to load):
[I:]: Found Xamarin.Android 8.0.0.33
[I:sdk]: Runtime path: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android
[I:sdk]: Framework path: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0
[I:sdk]: Key HKCU\SOFTWARE\Xamarin\VisualStudio\15.0_6c165955\Android\AndroidSdkDirectory found:
Path contains adb in \platform-tools (C:\Program Files (x86)\Android\android-sdk).
[I:sdk]: Key HKCU\SOFTWARE\Xamarin\VisualStudio\15.0_6c165955\Android\AndroidNdkDirectory found:
Path contains ndk-stack in \. (C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b).
[I:sdk]: Key HKCU\SOFTWARE\Xamarin\VisualStudio\15.0_6c165955\Android\JavaSdkDirectory found:
Path contains jarsigner.exe in \bin (C:\Program Files\Java\jdk1.8.0_131).
[I:]: Found Android SDK. API levels: 22, 23, 24, 25
Never worked with XAMARIN before but faced somewhat similar situations with other projects. Here's what you can do :
1. Create a new project
2. Right click on project > Add > Existing Item
3. Browse to the previous projects directory and add all the project files(i mean code files such as .cs)
**4. In winforms, if you add back a form's .cs file, it should automatically load the .designer.cs as well. **
After doing so, you can get back the entire project. There might be a few errors but they are easily fixable.
Hope this helps :)
I had a global.json with and sdk for dotnet core that wasn't installed.
Either install the targeted version or update your global.json to fit what you have installed.

Miscellaneous files in C#/Xamarin.Forms Shared Project

All .cs file in my Xamarin project are Miscellaneous files http://prntscr.com/cp3q4w . I have no Quick Actions and Refactorings support, and it seems like there is somehow missing reference to Xamarin.Forms http://prntscr.com/cp3qzr ,but i dont get compile error for not recognizing xamarin components.
This is Xamarin.Forms Shared project.
Tried with this solution:
i) Clear the cache
ii) Open the solution
iii) Unload all projects
iv) Load Android project and then fix nuget references
v) Once the references were fixed, I loaded the shared project. Now everything seems to work.
But, didn't succeed.
Anyone had similar problem? Any suggestions for solution?
Thanks.
First thing to try if your solution is checked in to source control:
Do a full Git clean to make sure there are no left over files stopping compilation
Clear your NuGet cache. (How to clear NuGet package cache using command line?)
Try again.
If this fails, try this:
Starting a new Visual C# -> Cross Platform -> Mobile App (Xamarin.Forms) solution in Visual Studio 2017. I recommend trying a ".NET Standard" project rather than a "Shared Project".
Make sure the solution compiles and runs to make sure you have all the necessary components for Xamarin Installed.
Do a back up of this clean solution, or commit it to source control.
Upgrade all the NuGet packages if necessary
Pull all the files in from your old solution and see if you get the same problem. Just remember to make sure that the files are added as the correct type of file. For example xaml files must be set to "Embedded resource".
If you still have trouble, please post the error that you get, and upload your solution somewhere so we can have a look.
This also happened to me.
It still does every now and again.
These steps work for me:
Close your solution.
Delete the packages folder from your solution folder or just rename it to packages.old
Open your solution and restore the NuGet packages.
The new class will now show up correctly and your intellisense should work again.
Does anyone have an idea what could cause this though as I don't see any errors when building?

VS2013 - Microsoft.Web.Services3 installed but not usable

A little fresh on the C# train... so this may be a dumb question.
I have installed the WS3.0 SDK.
I have a website created in VS2013.
using Microsoft.Web.Services3;
Gives me "does not exist in namespace..." error.
Tried adding manually through Add>Reference, but it is not listed anywhere.
I can confirm that a file name Microsoft.Web.Services3 exists in Windows/assembly directory.
What am I missing?
I found it, in part thanks to #TimFreese.
Went to "Browse" in the reference manager, found the .dll hiding out in
C:\Program Files (x86)\Microsoft WSE\v3.0

Visual Studio Code IntelliSense suggestions don't pop up automatically

I followed the install instructions in https://code.visualstudio.com, but when I write C# code, the IntelliSense suggestions don't pop up automatically, so I must trigger it by using shortcut Command+Space, meanwhile, the suggestions are just from the code I wrote.
Here is the screen capture below:
I checked in https://code.visualstudio.com/Docs/editingevolved, VSCode do support C# IntelliSense.
I don't think it is bug, maybe I did something wrong when installing VSCode. How to solve this problem?
To activate IntelliSense on a .NET project:
Open project folder: File->Open folder...
Click on the flame on your bottom left corner, pick your project
IntelliSense activated!
From what I've seen, IntelliSense cannot be activated on a .cs file alone.
(See #natemcmaster's answer).
OmniSharp doesn't know where your project files are. In your screenshot, the left sidebar says "You have not opened a folder". OmniSharp will look in your currently opened folder for project files.
Add your folder. File > Open Folder...
Make sure you have a project file (either project.json or your *.csproj files).
This should be enough for OmniSharp to start providing you Intellisense.
Try changing the editor.quickSuggestions setting to true in the settings.json file. The settings file may be found in:
Windows: %APPDATA%\Code\User\settings.json
Mac: $HOME/Library/Application Support/User/settings.json
Linux: $HOME/.config/Code/User/settings.json
You just have to pick up the language type from the bar at the bottom (the button with the flame).
In my case the problem was that I had 2 versions installed. I was launching from the command prompt and it kept running the older version. In Programs and Features, I removed the one that didn't have "(user)" at the end of the application name, and when I opened Code again, it started downloading packages, one of which was OmniSharp, and then IntelliSense started working.
Note that I was also getting the following warning when opening the older version, and searching for the warning led me to instructions on removing the other version, which in turn fixed the IntelliSense problem:
You are running the system-wide installation of Code, while having the user-wide distribution installed as well. Make sure you're running the Code version you expect.
Issue :
if i hit ! it was not showing any suggestion(emmet), i also tried to hit ctrl+space its was showing "no suggestions". i tried to uninstall and re- install vs code several times but seems its picking the previous settings somehow(for example old extensions are pre loaded with every fresh install).
So, i went to below path and deleted .vscode folder and it fixed the issue.
Steps:
uninstall vscode
go to below path
C:\Users<user_name_of_the_system>\
and delete .vscode folder
restart the system and install vs code
You will be all set..!!
Note : this is applicable only for windows pc

Categories