Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

c# - What is the best way to publish multiple versions of the same ClickOnce application?

I have a c# ClickOnce application that I need to be able to publish multiple times for OEM purposes.

The way I understand it now is that publish settings are located in the .csproj file. However, this is inconvenient in the case where I want to publish multiple versions.

for example, Company A needs totally different icons, start menu location, product name etc. from Company B, but the assemblies need not be renamed.

Here are a couple approaches/questions that I can think of to solve this issue...

1.Is there a way to create a separate publish settings file to use during build time?

2.Can I edit specific publish settings (like Start Menu location, etc) at build time with MSBuild.exe? I think this would be ideal... e.g.

MSBuild.exe project.sln /target:Publish /property:edit-project-publish-settings-here

3.Maybe create a 2nd .csproj file? (Would prefer not to do this...)

Please share your thoughts as to the best approach, or any other clever ways to make this happen. Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I wish I could give you some brilliant solution, but personally I would probably go with option 3.

I mean, its pretty simple, the changes should be pretty static and it will be difficult(ish) to totally screw it up and deploy the wrong changes to the wrong company.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...