Xamarin Forms compilation error in visual studio - visual-studio-2013

I am trying to make a simple xamairn form apllication by folling steps
l
after creating project when compile it

This is not a compilation error. Your solution should contain multiple projects - a PCL and one or more platform specific (iOS, Android, Windows Phone) projects. The PCL is just a library - you cannot run it. Instead you need to right click on one of the platform projects and select "Set as Startup Project". Then when you run your solution Visual Studio will execute that project in the appropriate simulator/emulator.

Related

Invalid value 'armeabi' in $(AndroidSupportedAbis). This ABI is no longer supported. Xamarin.Forms - VS2019

I have a Mobile App built with Xamarin.Forms
when I am trying to upgrade my project from VS2017 to VS2019
I get this error in Android Project
Invalid value 'armeabi' in $(AndroidSupportedAbis). This ABI is no longer supported. Please update your project properties
I tried to delete bin and obj folders to force the project to rebuild everything, but the error still appears
Can I get an explanation about the error above and how to solve it?
Note: the error doesn't appear in VS2017
armeabi is deprecated and your Android project should target armeabi-v7a and arm64-v8a at a minimum in your release builds destined for the Play Store.
You can directly edit your .csproj and remove the armeabi from within the AndroidSupportedAbis tags:
<AndroidSupportedAbis>armeabi-v7a;arm64-v8a</AndroidSupportedAbis>
Or you can open the Android Build settings in the IDE and it will auto-update it for you:
Targeting 64 bit architectures on Xamarin Android
It can be adjusted in 3 steps.
Step 1 - Right-click on Android Project and Click Properties:
Step 2 to 4:
Step 5 - Uncheck armeabi:
In Visual Studio, right-click on your project under the Solution Explorer and select Properties. Under the Android Options page check the Packaging properties section and verify that Use Shared Runtime is disabled (turning this off allows you to explicitly select which ABIs to support). Click the Advanced button and, under Supported architectures, check the architectures that you want to support:
tip: if you are unaware of arm architectures checking all will remove errors

Generate *.mdb file with Visual Studio 2017 for PCL

I want to create a NuGet Package of an PCL that Targets .NET, UWP, Android (Xamarin), iOS (Xamarin) and so on (for Example lets say Profile111).
When I reference the project in an Android app Visual Studio 2017 creates a *.mdb file which the mono debugger uses to enable step through code.
Now I wan't to get the same result with an Solution/Project that just contains the PCL code.
What I got when I compile my sample.csproj with VS2017 is
sample.dll
sample.pdb
whats missing:
sample.dll.mdb
At the end I want to be able to create a nuspec file like this one:
https://github.com/xamarin/Xamarin.Forms/pull/167/files
Every hint is welcome.
Tank you
Alex

Can't add PCL to existing Xamarin Forms project

Brand new install of Visual Studio Pro 2017, Prism Template Pack, and Xamarin Forms.
I am trying to create my first App and things are going very well so far. I have all the views, view models, etc. set and the app is functioning perfectly. Now I am trying to add some more PCL projects to the solution for things like Domain or Services, etc. so I can keep all the parts separated.
I can create a Xamarin Forms PCL just fine and add all my classes, etc. Problem comes when I try to add a reference to the Domain project from the main PCL project in the solution. I get the "targets of pcl don't match" error message.
This is what I am using to create the new PCL project:
This is the error message I receive when trying to add the PCL project reference:
What am I missing?
Here is the main PCL created with the template pack properties:
Here is the newly added PCL project properties:
PCL properties for template:
Since you are missing the Windows Phone & Silverlight targets in your IDE for some reason, this is a potential workaround:
Open up your .csproj files and make sure the TargetFrameworkProfile elements match up in both PCL projects.
Is it possible that you didn't install the tools for Windows Phone development when you installed Visual Studio?

How do I make MSBuild work with a UWP solution generated from a Unity3D project?

So I'm trying to automate the process for building a packaged app from a Unity project and I've hit a roadblock when trying to use MSBuild to build the final app packages.
In Unity, when you build for UWP, a folder /UWP/ is generated for the project. These contain csharp projects for two .dlls that are required to build the uwp app.
For me, these dlls got generated in a folder for each platform (x86,x64, and ARM), but this is where I hit the roadblock. To build the app packages I use MSBuild(I've also tried with the Developer Command Prompt - same result) with the command.
MSBuild "{Project}.csproj" /p:Configuration=Debug;AppxBundle=Always;AppxBundlePlatforms="x64";OutputPath="AppxPackages"
This throws the error
"C:\Users\{User}\Desktop\Output\{Project}\{Project}.csproj" (default target) (1) ->
(BeforeResolveReferences target) ->
C:\Users\{User}\Desktop\Output\{Project}\{Project}.csproj(319,5): error MSB3030: Could not copy the file "{path-to-unity-project}\UWP\Assembly-CSharp\bin\AnyCPU\Debug\Unprocessed\Assembly-CSharp.dll" because it was not found.
What is happening here is that MSBuild is attempting to find a dll in a folder "AnyCPU" that simply does not exist.
Is there any way I could tell MSBuild to individually build each platform rather than look for a combined dll, or am I using MSBuild incorrectly?
Even though I was unable to figure out why the Debug configuration looks for an assembly in the wrong directory, thanks to #Leo-MSFT I was able to fix the error that was occurring.
Firstly, I was calling MSBuild on the game project, this needed to be the generated solution instead.
Secondly, instead of using the Debug configuration, I used the Release configuration.
And finally, I was confused by the contents generated by the build compared to a build from Visual Studio (Right Click->Store->Create App Packages...). While VS generates an .appxbundle, using MSBuild will generate individually for each of the platforms selected such as game_x64.appx, game_ARM.appx, and a few more.
You can create the bundle yourself by using the makeappx tool.

How to run MFC application in windows XP without C++ redistributable support

My Development Environment is
C++
Visual Studio 2008
Windows 7
I'm going to start a project (MFC application) and final result (exe) should run on windows xp, vista ,windows 7 or windows 8 without installing any extra packages (like Visual C++ Redistributable package).
Questions:
Which kind of project I should select in visual studio?
What are the project settings I should specify?
You have to use MFC as a static library. Pay attention in project creation wizard for this option.
These are the basic things you have to consider when you start a project in Visual studio that need to run in target computer without installing any other redistribute components.
You have to select project type Win32-> Win32 Console Application or Win32-> Win32 Project as your console or GUI requirements.
You must select No Common Language Runtime support in right click project in solution explorer -> Properties -> General -> Common Language Runtime support
Your application need run-time assemblies to run in target computer. There is two methods to deploy run time DLLs in target computer
Assemblies link statically ( right click project in solution explorer -> Properties -> General -> Use of MFC and Use of ATL). but if your application combine with multiple DLL EXE and LIBs, this method is quite troublesome.
Deploy Runtime DLLs in target computer as private assemblies (I personally recommend this method). More details here
Expanding upon what's already been said..
You need to set the project to build as a static library:
Right click the project
Go to "Properties->Configuration Properties->General->Project Defaults->Use of MFC" set to "Use MFC in a Static Library"
You may also need to turn off the /MD flag if you're using it, and swap it out for '/MT' instead:
Right click the project
Go to "Properties->Configuration Properties->C/C++->Code Generation->Runtime Library" set to "Multi-threaded /MT"

Resources