如何在NServiceBus中更改序列化消息的命名空间

时间:2010-07-22 19:19:48

标签: nservicebus

我已尝试将appSetting“NameSpace”添加到我的发布商和订阅者,但邮件仍然包含名称空间http://tempuri.org/ ...

[编辑]

在发布商EndpointConfig中,我添加了:

public class ServerInit : IWantCustomInitialization
{
    public void Init()
    {
        Configure.With().XmlSerializer("http://foo.com");
    }
}

这有效,但我宁愿在配置文件中看到这一点。如果有人能提出办法,请告诉我。

2 个答案:

答案 0 :(得分:0)

只需将其放入您的应用设置中,然后使用.net配置管理器将其拉出来。

答案 1 :(得分:0)