简体   繁体   English

更改Xamarin Forms项目的名称空间和项目名称

[英]Change Namespace and Project name of a Xamarin Forms project

I need to change the namespace and project name of my Xamarin forms solution including PCL, .Andorid, .iOS and .UWP projects. 我需要更改我的Xamarin表单解决方案的名称空间和项目名称,包括PCL,.Andorid,.iOS和.UWP项目。

If I am not clear about what I want, I will also try to explain it with an example below; 如果我不清楚我想要什么,我也会尝试用下面的例子来解释它;

Let's say I created a Xamarin Forms PCL project named myProject. 假设我创建了一个名为myProject的Xamarin Forms PCL项目。 Visual Studio creates 4 projects named myProject(Portable), myProject.Android, myProject.iOS, myProject.UWP. Visual Studio创建了4个名为myProject(Portable),myProject.Android,myProject.iOS,myProject.UWP的项目。 Assume I created so much class in this projects that I don't want to rename all of them one by one. 假设我在这个项目中创建了很多类,我不想一个一个地重命名它们。 (Even if I did it, I am sure there will be some other places that stays same as I ignored them.) What I want is that I want to see 4 projects named mySecondProject(Portable), mySecondProject.Android, mySecondProject.iOS, mySecondProject.UWP as well as I want to see mySecondProject as the namespace of my classes. (即使我这样做了,我相信会有其他一些地方保持不变,因为我忽略了它们。)我想要的是我想看到4个项目名为mySecondProject(Portable),mySecondProject.Android,mySecondProject.iOS, mySecondProject.UWP以及我想看到mySecondProject作为我的类的命名空间。

Thank you very much. 非常感谢你。

Double click on the your namespace and right click and then: 双击您的命名空间并右键单击,然后:

Visual Studio 2015 -: Select “Rename” and enter your new namespace and press “Apply” on the dialog box Visual Studio 2015 - :选择“重命名”并输入新的命名空间,然后在对话框中按“应用”

Visual Studio for Mac -: Select “Refactor -> Rename” and enter your new namespace. Visual Studio for Mac - :选择“重构 - >重命名”并输入新的命名空间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM