Juansero29
Juansero29

Reputation: 251

How to rename a Xamarin Cross-Platform App?

I have created a new "Cross-Platform App (Xamarin.Forms)" project with Visual Studio 2017 like the screenshot belows shows it. This project was created with a name I wouldn't like to have now. As you may know, Xamarin creates 4 independent projects in when you create a new cross-platform app: an independent cross-platform project, an Android Project, an iOS project and an UWP Project.

I've tried renaming the solution as well as renaming each of the projects independently. I've tried using the Find and Replace tool to change each string in the solution containing my old project name for my new project name, but nothing has worked correctly. There are error messages like the following:

Severity    Code    Description Project File    Line    Suppression State
Warning     The "GenerateResourceDesigner" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'App, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'App.dll'
   at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
   at Xamarin.Android.Tasks.GenerateResourceDesigner.<>c__DisplayClass41_0.<Execute>b__2(String assembly)
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at Xamarin.Android.Tasks.ResourceDesignerImportGenerator.CreateImportMethods(IEnumerable`1 libraries)
   at Xamarin.Android.Tasks.GenerateResourceDesigner.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() App.Android         

And this one:

Severity    Code    Description Project File    Line    Suppression State
Warning     The "ResolveLibraryProjectImports" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'App, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'App.dll'
   at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
   at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName)
   at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(DirectoryAssemblyResolver res, ICollection`1 jars, ICollection`1 resolvedResourceDirectories, ICollection`1 resolvedAssetDirectories, ICollection`1 resolvedEnvironments)
   at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() App.Android         

TL;DR: Does anybody know how to rename a whole Xamarin Cross-Platform App correctly?

It would really be very helpful for me

Creation of the Project screenshot

Upvotes: 1

Views: 1724

Answers (1)

Kcj
Kcj

Reputation: 41

You have to go through and rename everything. rename the namespaces, the assemblies, maybe the files depending on what you originally had. Its just a bunch of changes you have to do by hand. You'll also have to manually edit the .cproj files to fix the paths to correspond to your new folder names etc.

Upvotes: 0

Related Questions