开发者

Is it safe to change application properties?

I see that my application has the wrong name.

When I go to:

Project -> Application properties...

I see an Assembly name and a default namespace.

Is it safe to开发者_如何转开发 just change these two to the values which would better represent my app or will it break something?


Its probably fine to change those two settings:

  • Assembly name is the name of the output assembly (without the extension)
  • Default namespace is the name of the namespace that Visual Studio uses when adding new code files.

As long as you don't have some code that depends on the assembly having a certain name you should be fine.


Yes, it is safe. Assembly name is your .exe or .dll file name. Default Namespace, in C#, is the default namespace inserte in top of your files when you create a new file. In VB.NET the "default namespace" means something different (it is prepended to every namespace you define in your project)


Yes, the default namespace is always safe to change. This will just affect what namespace Visual Studio will use when you create a new file in your project. It will not affect existing types; you will have to change those manually.

Assembly name is likewise safe to change.

However, if you have built other software against this assembly or distributed the assembly to others then changing the namespaces of types or the assembly name is a breaking change, and will cause those applications or assemblies to fail if used with a new version of your assembly.


You can certainly change them, but changing them will have consequences. Changing the assembly name simply changes the name of the output DLL or EXE file. The contents are basically unchanged, but anything that references your assembly will need to update the reference.

Changing the root namespace is a little more annoying, but it is also allowed. You will likely end up having to go through a lot of files and fix namespace references, and like renaming the assembly, anything that references your assembly will need to be updated.

From an API perspective, both of these are 'breaking' changes due to the required changes to anyone who references your assembly.


If it is a ClickOnce Application, you will have issues in autoupdate for existing installations.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜