Xamarin Studio iOS assembly error - c#

After I updated my Xamarin Studio (iOS) it gives me this error when trying to build/debug.
I ain't got no clue how to fix this, would appreciate some help
Error:
The type 'MonoTouch.UIKit.UIView' is defined in an assembly that is not referenced.
Consider adding a reference to assembly 'monotouch, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null'
I am using "AlexTouch.MBProgressHUD.dll" and I have added it to my usings.

The public key token of monotouch.dll changed in Xamarin.iOS 6.2 (it's not null anymore).
You'll need to recompile bindings (or assemblies) that refers to monotouch.dll or use the tool (from this thread) to update them.

Related

Nuget reference error, cannot find namespace

I've installed a NuGet-package required to run som code to create QR-codes. The package conflicts with system.drawing.common
Error CS0433 The type 'PixelFormat' exists in both 'CoreCompat.System.Drawing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c0a7ed9c2333b592' and 'System.Drawing.Common, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
I'm trying to solve it like this:
using PixelFormat = CoreCompat.System.Drawing;
Allthough it throws an error:
Error CS0246 The type or namespace name 'CoreCompat' could not be found (are you missing a using directive or an assembly reference?)
Obviously Visual studio knows it's there somehow thoug since otherwise there would not be a conflict.
I've tried reinstalling all related NuGet-packages.
How would i go about solving this?
CoreCompat is an old library built to provide a System.Drawing compatible API that would work in Core, as originally System.Drawing was not supported. Since that time, Microsoft has released System.Drawing.Common, which is its own Core-compatible System.Drawing replacement API. Somehow, you have references to both in your project.
If your QR code library is using CoreCompat, you should really file an issue with that project to ask them to update the dependency to System.Drawing.Common. Or, you can make the change yourself and submit a pull request. Otherwise, or until it's corrected, you may need to find a different library to use.
It's possible the dependency is coming from somewhere else, as well. Check your own projects to ensure you're not bringing that in. Ultimately, you're simply going to have to do a little research here and see where CoreCompat is coming from and get rid of that.

Failed to build UWP project with Visual Studio 2017 due to missing reference

I am trying to build a UWP project using Visual Studio 2017.
Without success :(
Here is the error messages content:
error CS0012: The type 'IAsyncOperationWithProgress<,>' is defined in an assembly that is not referenced. You must add a reference to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'.
error CS0012: The type 'IAsyncActionWithProgress<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'.
error CS0012: The type 'IAsyncOperation<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'.
error CS0012: The type 'IAsyncAction' is defined in an assembly that is not referenced. You must add a reference to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'.
error CS0103: The name 'Package' does not exist in the current context
The code lines inducing the errors all contain the await keyword and are like that:
var storageFolder = Task.Run(async () => await StorageFolder.GetFolderFromPathAsync(folderPath));
The "Quick actions" propose me to Add reference to 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'.
When I try, I have, in the Reference Manager' dialog :
The Universal SDK is already referenced. Please us the Object Browser to explore the references in th Universal Windows SDK.
And
No Framework assemblies were found on the machine
I un-installed VS and re-install => nothing changed
I un-installed all features/applications referencing .net and visual Studio and re-install VS => nothing changed
I tried installing the Windows 10 SDK (10.0.14393) before or after installing VS => nothing changed
I really have no idea of what goes wrong with my dev environment.
Do you know what the error messages mean ?
And does someone can help me to fix it?
TIA
I didn't know how I fixed the problem.
I "played" with the emulator extensions, especially the Android one.
Without understanding, while uninstalling it, my problem disappears.
Sorry, for the ones who will encounter the same problem I did, I close the discussion as my problem has been fixed, even if I can't explain why.

Xamarin unable to connect to mysql

db is my MySqlConnection. When I'm trying to run: db.Open(); I get this error:
The type 'System.Data.Common.DbConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”.
So I followed it and added System.Data reference. Now I get this error:
Reference to type 'Component' claims it is defined in System but it could not be found
I am using .NET Framework v4.0, MySQL Connector v6.9.9, Xamarin Forms v2.3.2.127 and all Android Support v23.4.0.1
P.S. I read something about PCL but I don't know if the package I am using i PCL.
Please specify database name in connection string
Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;
Pwd=myPassword
Maybe it's not a great solution, but I moved entire code to specific Android project and it works perfectly.

Error after installing Json.Net and reference it in the project. Windows Phone 8

I'm trying to read data from a json file in WP8 and after installing nuget displays the following error:
error :
Cannot resolve reference assemblies. Please check the reference assemblies. Cannot resolve dependency to assembly 'System.Runtime.InteropServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
Could anyone tell me a solution for this?
Add System.Runtime.InteropServices to your project references;
it's in the global assembly cache; the Add References dialog shows it under the ".NET" tab.
If this doesnt solve the problem following the directions here should allow you to remove the recursion that happens.

Does Scintilla need a directive? I keep getting an error?

So, when I drag in Scintilla to my C# form, and try to run it, I get the error:
The type or namespace name
'ScintillaNet' could not be found (are
you missing a using directive or an
assembly reference?)
The error appears to be coming from the designer for Form1.
I also get the warning (but not error):
The referenced assembly "ScintillaNet"
could not be resolved because it has a
dependency on "System.Design,
Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" which
is not in the currently targeted
framework
".NETFramework,Version=v4.0,Profile=Client".
Please remove references to assemblies
not in the targeted framework or
consider retargeting your project.
So, I can't run my program...
What's wrong, and how do I fix it? I've installed scintilla just like how the directions for it suggested...
I was also experiencing this error (although I am hosting in WPF not WinForms). It was caused by Visual Studio 2010 defaulting the project to .Net 4.0 Client profile rather than the full .Net 4.0 profile.

Categories