xamarin.forms with VS 2015 - c#

I start learning the Xamarin with the latest of VS 2015 (enterprise)
I create a a cross platform project with the 'blank xml app'
I got a solution with 5 projects created: portable, droid, ios, UWP and windows 8.1. All of them cannot get compiled at all, since the "initializecomponent" missing
After I've updated the package Xamarin.forms to the latest version, almost of them can be compiled without any errors, except the windows 8.1. I tried around but got no luck, please advise which packages I need to install to?
Edited: add an image "cannot install the package xamarin.forms for the two.windows"

Try to right-click the Two.Windows project -> click Manage NuGet Packages -> in the Installed packages tab, if Xamarin.Forms is listed, uninstall it -> Now click on the Online tab -> search for and install Xamarin.Forms only in your Two.Windows project
After that, I would completely close Visual Studio, click save if asked, delete all files and folders in each project folder's /bin/ and /obj/ folders, reopen the solution and rebuild the Two.Windows project.
If you still have issues after that let us know and also post a new image of the references listed under your Two.Windows project.
Edit: Here is a list of references that I see in my default Windows 8.1 project:
.NET for Windows Store app
Identity: .NETCore,Version=v4.5.1
Path: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETCore\v4.5.1\
Windows 8.1
Identity: Windows,Version=8.1
Path: C:\Program Files (x86)\Windows Kits\8.1\References\CommonConfiguration\Neutral\
Xamarin.Forms.Core
Xamarin.Forms.Platform
Xamarin.Forms.Platform.WinRT
Xamarin.Forms.Platform.WinRT.Tablet
Xamarin.Forms.Xaml
The I also have the reference to my shared project in there as well as Newtonsoft.Json, but I am not sure if that came by default or not.
Edit #2: Now that we know you are on Windows 7, we know why the Windows Phone 8.1 project is failing. Refer to this answer for more information but the short of it is that you cannot install the Windows Phone 8.1 SDK on Windows 7 nor can you deploy WP 8.1 apps using Windows 7. The answer also gives some alternatives you might be able to use. I think the upgrade is free from what I remember.

Related

Xamarin.IOS does not support running or debugging the previous built version of your project

error image
visual studio version
my IOS Version is 15.6.1
i have been login to my Account Apple Developer, and i want to build to local IOS but this message shown (error). anyone have solution for this?
have been deleted bin obj clean solution and rebuild, but not solved
To begin with, if you are building a Xamarin iOS project, try to change Deployment Target to 15.4 in the Info.plist file. If it is a Maui app, try to change the Minimum Target iOS Framework to 15.4 in the iOS Targets option.
If the above doesn't work, you can try to create an empty project in your Xcode to see if it can build and deploy to your iOS 15.6.1 device. If it still doesn't work, you may need to upgrade your Xcode to the latest version: Xcode14.2 and another physical device with iOS 16.2.
Hope it works for you!

Running Mono C# projects on Mac ... and Winforms

For the first time I am trying Visual Studio for Mac and I located a tutorial for writing a exe that shows a window with a simple menu.
My two questions are:
How does a user of a Mac get the Mono platform? I can't find instructions for deploying Mono. When I look in my exe folder there is no other files. Just the exe.
Maybe this should be a different question but I could not find any "WinForms" version in Visual Studio for mac. I had to use Gtk2 (I think).
If there is a better place to ask these questions please direct me. Thanks.
I know understand that the best course of action was:
Create a Xamarin.Forms multi-platform project.
Create a Cocoa Mac OS project.
Add a reference to project 1 into project 2.
Using Nuget Package Manager download Xamarin.Forms into each project.
Now it is easy to create an application with XAML (similar to WPF).
Visual Studio for Mac creates the multi-platform project (step 1 above) automatically with the Android and iOS platform builds, but not the macOS.
I also see that I don't really need to download Mono as it is all dealt with automatically.
.NET Core does support Mac and Linux. And even though .NET Core now supports Windows Forms. Windows Forms is only supported on Windows. It's unlikely this will ever change due to Windows Forms dependency on the Windows APIs.

Unable to load DLL 'sqlite3': in windows phone app.

I'm working on a windows Phone OLD application. I'm getting this issue related to SQL3.dll. in visual 2015.
Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
What I've tried, Done Cleaning all project, added sqlite.dll in Bin/debug folder, but I could not overcome this issue.
here is a screenshot.
I've tried adding a dll as reference (sqlite-winrt-3220000.vsix) but this is not compatible.
Any help would be appreciated.
Add the dll as a reference:
Right-click in "References" in the project you want to use it in and select "Add reference".
Select the option "Browse" and use the browse button to select the dll you want to include.
Add a using statement to the class.
After this you can use the dll in the project.
I've tried adding a dll as reference (sqlite-winrt-3220000.vsix) but this is not compatible.
SQlite is distributed as a VS extension. To add reference to your project, right click on References, “Add References”, “Windows Phone 8”, “Extensions”, check “SQLite for Windows Phone”, press OK.
No other steps are required, you don’t need other references and you don’t need to specify or deploy DLLs manually.
Also sqlite has different extension for WP8.1, you should probably install another one, sqlite-wp81-winrt-3220000.vsix.
Update: I think you’re trying to build for a platform that’s unsupported by SQLite library. SQlite for windows phone only supports 2 platforms, intel 32 bit (for emulators) and ARM (for devices and for the marketplace). It does not support AMD64, and it does not support “Any CPU”. You’re probably trying to build “Any CPU”, it’s usually the default platform for .NET.
Another possible reason is wrong project type. Your project has to be windows phone 8.1 app, not universal, i.e. the project name in the solution explorer panel must end with ”(Windows Phone 8.1)”
Update 2: I’ve compiled a simple app that uses sqlite, run it in emulator and it worked flawlessly on my PC. Ensure your references look like this:
If you have the same, make sure you have VS 2015 Update 3 installed. If you already have it, repairing your visual studio installation might help.

Use two NuGet packages with the same .dll name in Visual Studio

I'm trying to use two NuGet packages in my Visual Studio project which has the same output path; so, when I try to build, Visual Studio gives me
Payload contains two or more files with the same destination path 'MyNugetPackage.dll'
Is it possible to change the output .dll name of a NuGet library? If it's, how can I do this?
Thank you
EDIT: If someone is wondering why I want to load two version of the same package, that's because I'm trying to use ApplicationInsights in WP 8.1 Silverlight and RT projects with some shared code. I'm also using background tasks. The SL app uses the same bgtask as RT, so I need to load at the same time the RT and the SL packages of ApplicationInsights for the SL app.

How to use SQLite on new Windows 8.1 Store app (Visual Studio 2013)

So, I installed Visual Studio 2013 on my Windows 8.1 box. I want to experiment with it and created a new Windows Store Grid App. I want to persist data on a SQLite database, apparently the database of choice for WinRT apps.
Quickly found links to the vsix needed in order to be able to use the SDK: SQLite download page, and downloaded sqlite-winrt81-3080002.vsix.
Installed it, then in my project, added the reference to the newly installed SDK (right click references, add reference, navigate to Windows, select extensions and tick SQLite for Windows Runtime (Windows 8.1) checkbox.
Also quickly found that it won't compile on Any CPU. On Configuration Manager, selected Debug, x64 active platform, that made me able to compile the application.
Finally, while attempting to use the namespace SQLite I noticed VS 2013 isn't recognizing it. Attempted many things like adding reference to the .dll directly, exploring the component to see which namespaces were available (which doesn't show anything), and I'm quickly running out of ideas. Because it's kinda new thing, and with limited interest, google, the saviour, doesn't want to save me today.
So, how one would be able to use the SQLite SDK in their Visual Studio 2013 projects, targeting Windows Runtime 8.1?
These are the contents of my csproj file
UPDATE
Stupid me, thought there was no managed land (.net) in Metro style land. Sorry for causing any confusion.
I installed the VSIX for SQLite and noticed that it is a native DLL to be used in Windows Store 8.1 C++ apps. It is not for managed C# projects.
The current NuGet package for SQLite from what seems to be the 'official' SQLite team is only working for .NET 4.5, if you try to install it, it will error saying it does not support .NET 4.51.
There is also the NuGet package SQLite-net, which works for .NET Windows Store apps. All you need to add is the SQLite using statement.
You will need this NuGet package as it is the managed wrapper for the SQLite, without you will not be able to properly reference the right DLL for SQLite.
Here is the link to the project information from that NuGet package. SQLite Runtime Support
Here is an article on how to use SQLite with Windows Store apps in VS2012 but it should still all apply:
SQLite and Windows Store Apps

Categories

Resources