ClickOnce + extra ConfigFile?

G

Guest

I developed a WindowsForms application that i want to distribute with
ClickOnce.

I usually develop my applications with a three-layer structure:
Presentation, BusinessLogic, DataAccess. So far I have always put them in
seperate projects.

In VisualStudio2005 I found out that I can have a config-file in the
BusinessLayer and reach it with typed properties through the My.Settings
object. This is really nice since most config values are used in the Business
layer!

The problem arises when I want to use the inbuilt ClickOnce publishing
wizard. It will not include the config file of the Business project. If I
copy the config file manually and rename it, then everything works fine, so
distribution is the missing part here.

So what do you recommend:

1) Is there a way to force the wizard to include a specific file in the
manifest?

2) Should I use MageUI.exe to create manual manifests? I really want to
avoid this since it is seems quite complicated.

3) I tried to reach the My.Settings of the Presentation layer from the
Business layer, but only succeeded to retrieve it with GetRawXML which gets
quite complicated and untyped. Is there a better way that you know?

4) Should I skip the My.Settings typed properties and go for the old style
appSettings which means BusinessLayer can reach values in the Presentation
config?

5) Should I avoid the whole problem by populating a BusinessLayer Settings
object from the Presentation layer on application start?

6) Should I restructure my code and put all classes in the same project,
only separating them with namespaces and seperate folders? That means the
My.Settings object would be reachable all over. In this particular
application there is really no need for seperate DLL-files.

Any suggestions from all you experts out there?
 
K

Kevin Yu [MSFT]

Hi,

We have reviewed this issue and are currently researching on it. We will
update you ASAP. Thanks for your patience!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
J

Jeffrey Tan[MSFT]

Hi jaklithn,

Thanks for your post.

See inline...
1) Is there a way to force the wizard to include a specific file in the
manifest?
I have created a sample project in VS2005, which ClickOnce deploy, I can
succeesfully get the config files deployed. Can you provide some more
information to help me reprodoce out your problem?
2) Should I use MageUI.exe to create manual manifests? I really want to
avoid this since it is seems quite complicated.
Why you have to use MageUI.exe to create manual manifests? Can you show me
your concern, thanks
3) I tried to reach the My.Settings of the Presentation layer from the
Business layer, but only succeeded to retrieve it with GetRawXML which gets
quite complicated and untyped. Is there a better way that you know?
I do not think we can access another project's config files from the first
one. If you really want to do so, I think you have to explicitly manual
parse it. Or why not place the wanted config section informations with the
first project config file?

Let's first dicuss the first 3 questions, if I misunderstand you, please
feel free to tell me, thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
G

Guest

I have created a sample project in VS2005, which ClickOnce deploy, I can
succeesfully get the config files deployed. Can you provide some more
information to help me reprodoce out your problem?

Are you sure BOTH config files were included in the automaticly generated
list created by the ClickOnce Publish feature????
That's exactly what I want, but I don't get that result .....
When I review the "Application Files" list the config file from the
Presentation layer project is always included as it should, but my concern is
to include the config file from the Business layer, which is far more helpful
to have.
Just to ensure it is no problem with order of actions I created a new
solution and added both config files from the beginning, but with the same
result.

I tried to use "Application Configuarion file" and "Settings file" with the
same result. By the way: What is the difference between these file types? The
App.config is created visible but will also create a Settings.Settings
"shadow" file in the "My Project" directory. The "Settings file" is created
visible in the directory but the structure of the resulting VB-files seems to
be identical.

I use VB.Net. Do I need to use C# to get it working?
 
J

Jeffrey Tan[MSFT]

Hi jaklithn,

Thanks for your feedback.

I am not sure of what does "BOTH config files" mean. Do you mean 2
projectis? Actually, I do not have your 3 projects environment, I just test
1 ClickOnce project, and its app.config deploys well. Do you deploy all the
3 projects through clickonce? How do you cross-project to access the config
file? I think clickonce will only deploy the app.config file for the
project you are deploying.

The Settings.Settings file is used for setting the "Settings.Settings
designer", it coordinates with Settings.Designer.vb to implement the
designer function. This designer finally generates the app.config file.

If you can provide some detailed steps to reproduce out your problem, we
can understand it better.

Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
G

Guest

I am not sure of what does "BOTH config files" mean. Do you mean 2
projectis? Actually, I do not have your 3 projects environment, I just test
1 ClickOnce project, and its app.config deploys well. Do you deploy all the
3 projects through clickonce? How do you cross-project to access the config
file? I think clickonce will only deploy the app.config file for the
project you are deploying.

Yes, as I stated in the initial question I use seperate projects.
I understand from your answer that it is not possible to deploy them like
that.
I will rearrange.

Thanks.
 
J

Jeffrey Tan[MSFT]

Ok, if you need further help, please feel free to post, thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top