一切都可以在 WCF 中以编程方式完成还是某些功能的配置文件?

编程入门 行业动态 更新时间:2024-10-23 23:21:35
本文介绍了一切都可以在 WCF 中以编程方式完成还是某些功能的配置文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我非常喜欢在代码中工作,利用 IntelliSense 并开放 C# 语言的所有功能以使用 WCF 但我想确保我不会朝着最终会限制我可以访问的 WCF 功能集的方向前进.我对 WCF 的经验如此有限,以至于我不明白使用配置文件的好处,尤其是如果您可以在代码中完成所有操作 (?).

I have a strong preference for working in code, leverage IntelliSense and opening up all of the power of the C# language to work with WCF but I want to make sure that I'm not moving in a direction that ultimately will limit the WCF feature set I can access. My experience is so limited with WCF that I don't understand the benefits of using the configuration files, especially if you can do everything in code (?).

注意:我使用的是 .NET 3.5.

Note: I'm using .NET 3.5.

您能否以编程方式使用 WCF 做所有事情",或者完整的 WCF 功能集是否需要配置文件?

Can you do 'everything' with WCF programmatically or are configuration files required for the full WCF feature set?

推荐答案

您可以在代码和配置中完成大约 99.8% 的事情.

You can do about 99.8% of things in code as well as config.

有些事情只能在代码中完成 - 例如在需要这两个身份验证的呼叫中设置用户名和密码.

Some things can be done only in code - like setting user name and password on a call that requires those two for authentication.

而且似乎有一些事情只能在配置中完成 - 请参阅其他 最近的 SO 问题 举个例子.

And there appear to be a few things that can be done in config only - see this other recent SO question for one example.

但我认为,如果您更喜欢代码,那么在大多数情况下应该没问题.

But I think, if you prefer code, you should be fine for the vast majority of cases.

马克

这篇关于一切都可以在 WCF 中以编程方式完成还是某些功能的配置文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-26 20:00:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1141080.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:一切都   中以   配置文件   方式   功能

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!