I have a Xamarin.Forms PCL project with multiple localizations that are specified in *.resx files and several platform-specific localization files (native for Android and UWP).
This solution is being built using MSBuild. I want to specify languages that will be included in each build. How it can be achieved using MSBuild and standard Xamarin build procedures without modifying *.csproj files before each build?
Related
I have a Xamarin.Forms project targeting iOS and Android. In a shared netstandard library which is referenced by the iOS and Android project i would like to use a specific NuGet PackageReference based on the on the platform the library is referenced by. The problem is that because of my project structure i cannot multi-target the netstandard project - is there a way to achieve such a scenario without adding multiple TargetFrameworks to the head project?
Could this condition be done with custom configurations i.e. Debug | iOS or Debug | Droid
We need to bind the Pulltoloadmoreandrefresh Eclipse Library Project in our Xamarin Android project as mentioned in Binding an Eclipse Library Project.
We created the Eclipse library project, added the respective files (screenshot for reference), and created the zip files with res and bin folders as mentioned in the above link.
Created the Android Library Project in Visual Studio and added the the zip file. But it shows error "At least one Java library is required for binding, this must be either 'EmbeddedJar', 'InputJar' (for jar), 'LibraryProjectZip' (for aar or zip) or 'LibraryProjectProperties' (project.properties) build action" for build action "LibraryProjectZip"
Kindly suggest on how to resolve this.
I solved this problem by swapping in Build Action.
For me the solution came with the type InputJar in the project that generates the library for Xamarin.
I created a Xamarin project MyApp within VS2015. This ends up creating a bunch of projects including MyApp.Droid for Android. I can build and deploy this project just fine on my Android device.
Next, I created a shared C++ Dynamic Shared Library (Android) project MyShared. When I try to add this project as a reference in MyApp.Droid, it reports an error that only .dll or .exe file types can be added as a reference and not .so types.
Wondering if there is a different way to add a native library project as a dependency. Regards.
Xamarin.Android supports the use of native libraries via the standard PInvoke mechanism.
You will need to define the DllImport C# attributes/signatures, there are various tools such as SWIG, PInvoker Visual Studio Addin, Mono's CppSharp, etc.. that can assist in this step.
(Personally I use Mono's CppSharp, but it might be overkill depending upon the number of classes/methods/functions there are within your C++ library.)
Mono Interop with Native Libraries
Xamarin.Android : Using Native Libraries
To interop with native libraries in your Xamarin.Android project, all you need to do is create a DllImport function declaration for the existing code to invoke, and the runtime will handle the rest. Set the EntryPoint to specify the exact function to be called in the native code.
Build and Debug C++ Libraries in Xamarin.Android Apps with Visual Studio 2015
I've got ProjectA. It has a WinForm and some .resx files in it. I created a Shared Project (ProjectA-shared) and moved everything to it. ProjectA references ProjectA-shared.
When I compile the Solution with VS2013 and the Shared Project plug-in, I get the following exception when running the app:
Could not find any resources appropriate for the specified culture or
the neutral culture. Make sure "Foo.Controls.MyForm.resources" was
correctly embedded or linked into assembly "Foo" at compile time, or
that all the satellite assemblies required are loadable and fully
signed.
When I compile the Solution with VS2015, everything is OK.
I am now left wondering:
Why would there be a difference between the VS2013 and VS2015 outputs?
It looks like .resx and WinForms aren't a natural fit for 'Shared Projects': what is the best way to share this kind of thing between two projects (primarily, projects using Shared Project just so that they can target .NET 4 and 4.5)
We are trying to move from C++ VS2005 to VS2010, but can't figure out how to move from the solution dependency model to the MSBuild project reference model. We have multiple developers, but don't distribute all the source to each developer although each developer is provided with all the header files, .lib, and .dll files.
With VS2005, each developer has their own solution and sets up a project dependency to a project, unique to that developer, which includes all the .lib files they don't have source for. This way, they can use the most current .vcproj files for the source they do have.
In trying to move to VS2010 / MSBuild, the project files now require that dependencies be included as references, yet some developers will not have a copy of the referenced project, only its .h and .lib.
Is there any way to combine the solution-based dependency model of VS2005/VS2008 with the MSBuild project reference model of VS2010?
MS removed implicit adding libraries in linker list once dependency added.
Now libs should be explicitly specified in Additional Dependencies of linker settings as well as includes in settings of compiler.