如何从现有项目创建C#项目? [英] How to create a C# project from an existing project?

查看:103
本文介绍了如何从现有项目创建C#项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在对C#项目Project1进行重大更改之前,我想将Project1保存为Project2.它会在Project1和Project2之间造成一些冲突吗?例如,我在IDE上看到以下名称:
测试(文件系统中的文件名为Testing.cs)
程序(文件系统中的文件名为Program.cs2.cs)

它是一个简单的应用程序:它生成随机数,进行一些数字运算,并使用Debug语句在大约100行中显示输出.)

关于测试名称,程序名称和其他任何名称,我应采取哪些预防措施?

谢谢.

Sohan Jain

Before I make a major change in my C# project Project1, I want to save the Project1 as Project2. Can it create some conflict between Project1 and Project2? For example, I see the following names on IDE:
Testing (with file name Testing.cs in the file system)
Program (with file name Program.cs2.cs in the file system)

It is a simple application: It generates random numbers, does some number crunching and displays an output in about 100 lines using Debug statement.)

What precautions should I take regarding the names Testing,Program and any other names?

Thank you.

Sohan Jain

推荐答案

这与克隆完全不同,这是浅表副本".源项目和目标项目将处于永久冲突,因为它们实际上共享相同的源代码文件.复制项目的整个想法表明缺乏设计和重复使用代码的情况(看起来像是您的解释);您不需要使用代码,而需要将代码放入库中,在不同的项目中使用它们,等等.但是,有时需要克隆项目以实现代码的重新分解和其他类似目的.首先,您需要确切地知道什么是源代码,什么是临时文件,输出以及其他非源工件.这对于编程以文件形式了解编程的每个工件的目的非常重要.您还应该能够删除项目模板的所有未使用的工件:未使用的资源,配置文件等,以及重要的是未使用的引用.如果知道所有这些,那么克隆就很简单:删除所有临时文件,然后将整个项目目录复制到新位置.

—SA
This is nothing like a clone, this is a "shallow copy". The source and destination projects will be in a permanent conflict because they actually share the same source code files. The whole idea of copy project suggests the lack of design with code re-used (it looks like per your explanation); you don''t need to use code but need to put code in libraries, use them in different projects, etc. However, cloning projects is sometimes needed for re-factorization of code and other similar purposes. First of all, you need to know exactly what is your source code and what are the temporary files, output, and other non-source artifacts. This is very important for programming to know the purpose of every artifact of programming in the form of file. You also should be able to remove all unused artifacts of project templates: unused resource, configuration files, etc., and, importantly, unused references. If you know all that, the cloning is simple: you remove all temporary files and copy a whole project directory to a new location.

—SA


这篇关于如何从现有项目创建C#项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆