Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何更改NServiceBus中序列化消息的命名空间_Nservicebus - Fatal编程技术网

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

如何更改NServiceBus中序列化消息的命名空间,nservicebus,Nservicebus,我已尝试将appSetting“NameSpace”添加到我的发布服务器和订阅服务器,但消息仍然包含该名称空间 [编辑] 在publisher EndpointConfig中,我添加了: public class ServerInit : IWantCustomInitialization { public void Init() { Configure.With().XmlSerializer("http://foo.com"); } } 这是可行的,

我已尝试将appSetting“NameSpace”添加到我的发布服务器和订阅服务器,但消息仍然包含该名称空间

[编辑]

在publisher EndpointConfig中,我添加了:

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

这是可行的,但我更希望在配置文件中看到这一点。请告诉我是否有人可以建议这样做。

只需将其放在应用程序设置中,然后使用.net配置管理器将其拉出。

谢谢Udi,我注意到分发服务器已经从应用程序设置中读取了此内容,我只是想知道为什么其他人不这样做。

因为管理员不可能在你的应用程序中意外更改。分发服务器已将其公开,因此您无需重新编译它。