如何使用不同的配置不同的程序集的名字吗?不同、如何使用、名字、程序

2023-09-03 03:48:20 作者:没有结局的结局つ

在Visual Studio 2008中(及其他)创建.NET或Silverlight应用程序时,如果你看看你的项目属性,好像你只能有一个程序集名称 - 在所有配置。我想我的编译应用程序:

In Visual Studio 2008 (and others) when creating a .NET or silverlight application if you look at your project properties, it seems like you can only have one assembly name - across all configurations. I would like to compile my application as:

MyAppDebug - 在调试模式 和公正 MyApp的 - 在释放模式

MyAppDebug - in debug mode and just MyApp - in release mode

有谁知道这是可能的吗?

Does anyone know if this is possible?

编辑:

这似乎有些人质疑这个问题背后的原因,所以我将解释远一点:

It seems some people are questioning the reasoning behind the question, so I'll explain a little further:

我正在一个Silverlight应用程序,它就会自动上传到我们的测试网站,当我到了构建解决方案。麻烦的是,测试团队正在测试在线版,而我工作的一个新的。所以,我想有这样一个URL。\ MyApp.html为普通版本,QA团队将测试,然后\ MyApp.html?版本=调试为我工作的当前版本。

I'm working on a Silverlight application which gets automatically uploaded to our test site when I to a "build solution". The trouble is, the test team are now testing the online version, whilst I work on a new one. So, I want to have a url like .\MyApp.html for the regular version that the QA team will test and then .\MyApp.html?version=debug for the current version that I'm working on.

推荐答案

我已经成功地实现我是什么后,使用后生成脚本:

I've managed to achieve what I was after by using a post-build script:

if "$(ConfigurationName)"=="Debug" goto debug
"$(SolutionDir)ftp.bat" "$(TargetDir)$(TargetName).xap"
:debug
"$(SolutionDir)ftp.bat" "$(TargetDir)$(TargetName).xap" "$(TargetDir)$(TargetName)Debug.xap"

我的FTP脚本基本上接受的到底哪一个是上传文件作为一个可选参数。所以,在我的本地计算机上的文件名总是相同的,但在调试模式下,我们把它上传与调试,在文件名的末尾。现在我可以在我的网页选择显示哪个版本。

My ftp script basically accepts an optional parameter at the end which is what to upload the file as. So on my local machine the filenames are always the same, but in debug mode we upload it with "Debug" at the end of the filename. Now I can choose in my webpage which version to show.