I want to rename my demo name in a good project name. i search for a solution but nothing clear showed a solution, the problem is that if you rename the project, the project folder (with the old name) directory , gives errors, and everything is messed up. it must be easy, but it isnt or is it?
How to rename a Xamarin.forms project in Visual Studio
Could not load assembly 'Autofac'
Hi everyone,
I decided to use Autofac for my dependencies injections.
I'm developing a Xamarin.Form app.
I installed Autofac through Nugget Package Manager in my PCL project (Xamarin.Form).
When I try to build, I get the following error :
Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Autofac, Version=4.3.0.0, Culture=neutral. Perhaps it doesn't exist in** the Mono for Android profile**?
Nom de fichier : 'Autofac.dll'
à Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
à Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
à Xamarin.Android.Tasks.ResolveAssemblies.Execute() MyApp.Droid
I don't understand how my Xamarin.Android project require Autofac when I don't use it inside...
Could anyone help me with that?
Thanks
How do I avoid different versions of an assembly in my App?
Hi,
In my solution I have several PCL-Projects that all use Nuget-Packages, some of them use the same packages. How can I make sure that all Projects use the same assembly versions? Especially when you update components, is there a way to update all projects at once?
If I have two versions on ony assembly in my App are both of them loaded at runtime?
I also have some warnings:
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1819,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2> No way to resolve conflict between "System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Choosing "System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
2> Consider app.config remapping of assembly "System.Net.Http, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "1.5.0.0" [] to Version "4.0.0.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Net.Http.dll] to solve conflict and get rid of warning.
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1937,3): warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file:
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1937,3): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
Thanks
Thomas
Could not load file or assembly SQLite-net, Version=1.4.118.0, Culture=neutral, PublicKeyToken=null
In SQLLite-net-pcl 1.4.118 I have this error on UWP:
Could not load file or assembly 'SQLite-net, Version=1.4.118.0, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference.
So, I have downgrade sqlite version to 1.3.3 : stack
But same error:
{System.IO.FileLoadException: Could not load file or assembly 'SQLite-net, Version=1.4.118.0, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'SQLite-net, Version=1.4.118.0, Culture=neutral, PublicKeyToken=null'
at GestionnaireCopropriete.Database.GCDatabase..ctor(String dbPath)
at GestionnaireCopropriete.App.get_Database()
at GestionnaireCopropriete.SettingsPage..ctor()}
I have clean. Closed and reopen. Delete /obj /bin... I don't understand why this problem is again her.
Can i bind multiple viewmodel to a single view..?
Can we bind more than one viewmodel for a view.
MR.Gestures handles ALL touch gestures
With MR.Gestures you can handle the Tapping, Tapped, DoupleTapped, LongPressing, LongPressed, Panning, Panned, Swiped, Pinching, Pinched, Rotating and Rotated gestures on all layouts, cells, views and on the ContentPage.
The code can be as easy as
var box1 = new MR.Gestures.BoxView { Color = Color.Red };
box1.LongPressed += (s, e) => { Console.WriteLine("Code: Red LongPressed"); };
Or in XAML
<br /><mr:ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:mr="clr-namespace:MR.Gestures;assembly=MR.Gestures"
x:Class="GestureSample.Views.ContentViewXaml"
Padding="50"
TappingCommand="{Binding TappingCommand}"
TappedCommand="{Binding TappedCommand}"
DoubleTappedCommand="{Binding DoubleTappedCommand}"
LongPressingCommand="{Binding LongPressingCommand}"
LongPressedCommand="{Binding LongPressedCommand}"
PanningCommand="{Binding PanningCommand}"
PannedCommand="{Binding PannedCommand}"
SwipedCommand="{Binding SwipedCommand}"
PinchingCommand="{Binding PinchingCommand}"
PinchedCommand="{Binding PinchedCommand}"
RotatingCommand="{Binding RotatingCommand}"
RotatedCommand="{Binding RotatedCommand}"
>
MR.Gestures is available via NuGet. More info on http://www.mrgestures.com/.
There is also a sample app available to download from https://github.com/MichaelRumpler/GestureSample. The GestureSample demonstrates how to use all the gestures with all Xamarin.Forms elements.
Custom Navigation Bar
Hi,
I'm building a enterprise app in Xamarin Forms mainly targeting Tablets. We received few mockups from client and they insist to have the consistent layout on all 3 supported platforms - typical. One of many things they are asking is to put an image in Navigation bar. As per my understanding not all platforms provide this. Is it OK if I hide the native navigation bar and then build my own custom view and put that in on each page?
Is it OK to do such customisation? Not to mention this is the first time I'm using Xamarin so watch me out guys
Thanks for the help in advance!
Progress Bar MVVM
Hi guys i would like to know how to implement a Progessbar using the MVVM pattern. I have a few WCF service calls in my ViewModel and would like to show progress on the main View.
I thought it would be as simple as
And then updating the double progress on my Viewmodel using
INotifyPropertyChanged
and setting OnPropertyChanged every time i update the value
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
However the progress UI is not updated until the method returns?
The sample https://developer.xamarin.com/api/type/Xamarin.Forms.ProgressBar/
Works fine but it seems none of these Views have proper samples for an MVVM pattern
Any help would be greatly appreciated
Can I disable ViewCell.ContextActions based on a condition
Hi I using a Xamarin Forms ListView and I want to know if I can disable the Context Actions based on a certain binding or in the code behind
I am using one GroupedListView for the whole application but it displays different data based on what the user is doing. There is a "Manage your Favorites" feature where I want the user to be able to swipe-to-delete on iOS or long-press on android to remove a ListItem, but I do not want this behavior if the list is displaying some search result or something else
<ViewCell.ContextActions>
<MenuItem Text="Delete" IsDestructive="true" CommandParameter="{Binding .}" Command="{Binding Path=BindingContext.OnDeleteCommand, Source={x:Reference Name=ListViewPage}}"/>
</ViewCell.ContextActions>
This did not disable it...
<ViewCell.ContextActions IsEnabled="false"> //This IsEnabled does nothing
<MenuItem Text="Delete" IsDestructive="true" CommandParameter="{Binding .}" Command="{Binding Path=BindingContext.OnDeleteCommand, Source={x:Reference Name=ListViewPage}}"/>
</ViewCell.ContextActions>
[Android] Can I check if I can send an email?
Hi guys,
I created an implementation for sending an email. In iOS I can check if I can send an email with MFMailComposeViewController.CanSendMail
. I can't find a similar command for Android.
Webview content is not getting resized on softkeyboard popup
We have a webview and it is populated with a webform. On text box focus, softkeyboard is appearing but it is overlapping the form and text area.
The Webview resides inside a navigation page, I have tried with below workaround mention in forums but it doesn't work.
APP.cs
using AndroidSpecific = Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
AndroidSpecific.Application.SetWindowSoftInputModeAdjust(this, AndroidSpecific.WindowSoftInputModeAdjust.Resize);
mscorlib conflict between versions
Hello
I have a Xamarin Forms Shared Project which can build and deploy without errors. However, the following build warning have appeared:
There was a conflict between "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e".
1> No way to resolve conflict between "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Choosing "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
The build warning seems to have appeared after updating Visual Studio and I cannot get rid of it.
I have tried cleaning the project, removing bin folder, .vs folder and building a new project with the same dependencies but that does not replicate the warning.
I have found other posts with a similar issue to this but I do not know if those problems are related:
https://developercommunity.visualstudio.com/content/problem/45257/no-way-to-resolve-conflict-between-mscorlib-versio.html
https://forums.xamarin.com/discussion/71781/how-to-get-rid-of-there-was-a-conflict-between-warnings-reported-between-different-packages
https://forums.xamarin.com/discussion/100868/mscorlib-version-2-0-5-0-vs-version-4-0-0-0#latest
I have the following versions:
Microsoft Visual Studio Enterprise 2017
Version 15.3.2
VisualStudio.15.Release/15.3.2+26730.10
Microsoft .NET Framework
Version 4.6.01586Installed Version: Enterprise
Architecture Diagrams and Analysis Tools 00369-60000-00001-AA938
Microsoft Architecture Diagrams and Analysis ToolsVisual Basic 2017 00369-60000-00001-AA938
Microsoft Visual Basic 2017Visual C# 2017 00369-60000-00001-AA938
Microsoft Visual C# 2017Visual F# 4.1 00369-60000-00001-AA938
Microsoft Visual F# 4.1Application Insights Tools for Visual Studio Package 8.8.00712.1
Application Insights Tools for Visual StudioASP.NET and Web Tools 2017 15.0.30726.0
ASP.NET and Web Tools 2017ASP.NET Core Razor Language Services 1.0
Provides languages services for ASP.NET Core Razor.ASP.NET Template Engine 2017 15.0.30726.0
ASP.NET Template Engine 2017ASP.NET Web Frameworks and Tools 2017 5.2.50601.0
For additional information, visit https://www.asp.net/Azure App Service Tools v3.0.0 15.0.30728.0
Azure App Service Tools v3.0.0Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.JavaScript Language Service 2.0
JavaScript Language ServiceJetBrains ReSharper Ultimate 2017.1.3 Build 108.0.20170613.154143
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2017 JetBrains, Inc.Merq 1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.50719.1Microsoft Continuous Delivery Tools for Visual Studio 0.3
Simplifying the configuration of continuous build integration and continuous build delivery from within the Visual Studio IDE.Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual MachinesMicrosoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggersMono Debugging for Visual Studio 4.6.8-pre (ec7034f)
Support for debugging Mono processes with Visual Studio.NuGet Package Manager 4.3.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.SQL Server Data Tools 15.1.61707.200
Microsoft SQL Server Data ToolsTypeScript 2.3.4.0
TypeScript tools for Visual StudioVisual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual StudioXamarin 4.6.0.299 (b63523e27)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.Xamarin.Android SDK 7.4.0.21 (2851083)
Xamarin.Android Reference Assemblies and MSBuild support.Xamarin.iOS and Xamarin.Mac SDK 10.12.0.20 (80b8487)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
I would like to know the cause of this, and if it is a serious problem that should be fixed?
I have attached the full warning
Thanks in advance
How to call web service in xamarin forms.
I have URL of web service and IP address of server machine. And lets say Web service is written only a simple text message. How can I call web service in xamarin forms in shared code on button click?
Call Navigation.PushAsync from ViewModel
Hello,
I want to push a new page from a viewModel.
Can I call this method from outside the page?
Thanks in advance.
Mostafa
Get device country location
Hi,
I am trying to work out what country the device is in while offline, I can get the GPS location but that won't give me the country. Is there a way to get the country from the Cell provider using Xamarin.Forms?
Getting Error while using PCLAppConfig
I got this error:
"unhandled Exception:
System.IO.FileNotFoundException: please link the 'App.config' file from your shared pcl project to
the 'Assets' directory of your android project, with build action
'AndroidAsset'"
any ideas ?
I have linked the App.config file in android assets , still the error is coming
Invalid value for slider minimum
Hello,
i'm trying to set a minimum value for a slider:
Slider slider = new Slider { Minimum = 30.0, Maximum = 60.0, Value = 45.0 };
This results in an exception:
System.ArgumentException: Value was an invalid value for Minimum
Parameter name: value
I can set the minimum without problems to zero or a negative value, but a value greater than zero throws the error.
Is this working as intended or a bug?
Regards,
Dirk
Get flash available Cross Plattform
Hy,
i´m using the lamp plugin to turn on and of the camera flash.
But if its not available the function will crash. The project has a pull request to fix this issue, but it is not integrated by now.
So i want to whether or not a flash is available...in the best case cross plattform.
Did anyone can point me to a code snippet?
Thanks
Can anyone provide me code for the SQLite connection and retrieving data using MVVM?
Hello everyone. I have just started using xamarin and I am using MVVM pattern for coding. I am not getting proper tutorials for database connection in Xamarin using MVVM
iOS Forms App Crashing - Too Many Open Files?
Hi,
I am getting HockeyApp reports that the iOS version of a (fairly complex) app I have developed is crashing with an IOException 'Too many open files'.
The stacktrace doesn't tell me much of use but there's nothing in there that references my code and it seems to be caused by forms saving properties or something?
I seem to remember somewhere there was something built in to Forms for saving user setting etc - I don't use this, I use my own methods (using IsolatedStorage) but not of that is referenced here and I am sure to close and remove references to all streams,
Does anyone have any pointers as to what might be causing this and/or how to debug the issue. Unfortunately I can't afford access to the Xamarin profiling tools and XCode Instruments just locks up when I try to attach it to my app (which seems to be a common issue).
Thanks in advance.
=====
System.IO.IOException: Too many open files
System.IO.FileStream.FileStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, bool anonymous, FileOptions options)
System.IO.FileStream.FileStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, bool isAsync, bool anonymous)
System.IO.IsolatedStorage.IsolatedStorageFileStream.IsolatedStorageFileStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, IsolatedStorageFile isf)
System.IO.IsolatedStorage.IsolatedStorageFileStream.IsolatedStorageFileStream(string path, FileMode mode, IsolatedStorageFile isf)
System.IO.IsolatedStorage.IsolatedStorageFile.OpenFile(string path, FileMode mode)
Xamarin.Forms.Platform.iOS.Deserializer.<>c__DisplayClass2_0.b__0()
System.Threading.Tasks.Task.InnerInvoke()
System.Threading.Tasks.Task.Execute()
Xamarin.Forms.Application.d__74.MoveNext()
Xamarin.Forms.Application.d__51.MoveNext()
Xamarin.Forms.Platform.iOS.FormsApplicationDelegate.d__8.MoveNext()
UIKit.UIKitSynchronizationContext.c__AnonStorey0.<>m__0()
Foundation.NSAsyncActionDispatcher.Apply()
UIKit.UIApplication.UIApplicationMain(int, string[], intptr, intptr)(wrapper managed-to-native)
UIKit.UIApplication.Main(string[] args, IntPtr principal, IntPtr delegate)
UIKit.UIApplication.Main(string[] args, string principalClassName, string delegateClassName)
OpenHouse.iOS.Application.Main(string[] args)