小编Bar*_*yży的帖子

appsetting.json 中的 WCF 服务客户端配置(.NET Core)

有没有办法从配置文件配置WCF服务引用?我想使用 SecurityMode、Address、ReaderQuotas 等设置来配置 WCF 服务引用。我还希望能够在 WsHttpBinding、BasicHttpBinding、BasicHttpsBinging 等之间进行选择(就像 .NET Framework 中 app.config 提供的正常配置一样)。

有没有办法在 .NET Core/.NET Standard 中实现这一目标?

谢谢,巴特克

.net c# wcf .net-core

7
推荐指数
1
解决办法
1万
查看次数

让 Git 在 Visual Studio 中忽略 WebDeploy 的 PublishProfile

我在 Azure 上托管 ASP.NET MVC 应用程序,因此我使用 WebDeploy。有一个包含我的发布配置文件的文件夹,其中包含AppName Web Deploy.pubxml,其中包含 db 的密码。因此,如果我将更改推送到 Github,每个人都可以看到我的数据库密码。

我使用 Visual Studio 的 Git 扩展,我想“取消跟踪”这个文件夹。我怎样才能做到这一点?

git github azure visual-studio microsoft-web-deploy

3
推荐指数
1
解决办法
3683
查看次数

比c#中的Invoke匿名方法更清洁

这是编写此代码的更好方法吗?这种方式看起来很复杂.我想example根据需要分配值anotherVariable.

var example = new Func<DateTime>((() =>
{
    switch (anotherVariable)
    {
        case "Jesus birth": return new DateTime(0, 12, 24);
        case "Second condition": return new DateTime(2017, 23, 11);
        // etc
        default: return DateTime.Now;
    }
})).Invoke();
Run Code Online (Sandbox Code Playgroud)

.net c# anonymous-function func

0
推荐指数
1
解决办法
72
查看次数