小编Or *_*r A的帖子

每个配置文件只能出现一次!为什么?

我得到以下例外:"每个配置文件只能出现一次.请参阅帮助主题以了解异常."

我的配置文件如下所示:

<configSections>
    <sectionGroup name="point.System">
        <section name="singleInstanceCache"
            type="xyz.Point.System.Configuration.SingleInstanceCache, Point.System" />
    </sectionGroup>
    <sectionGroup name="point.Services">
        <sectionGroup name="xServices" type="xyz.Point.Messaging.PointServiceConfiguration.PointServices, Barcap.FIA.Point.Messaging">
            <section name="xService"
                type="xyz.Point.Messaging.PointServiceConfiguration.PointService, Barcap.FIA.Point.Messaging" />
        </sectionGroup>
    </sectionGroup>
</configSections>

<point.Services>
    <xServices>
        <xService name="Service1" type="IService" >
            <endpoints>
                <endpoint aliasName="incoming" endpointName="Subscriber"/>
                <endpoint aliasName="outgoing" endpointName="Publisher"/>
            </endpoints>
        </xService>
        <xService name="BlobService" type="IPortfolioService" >
            <endpoints>
                <endpoint aliasName="incoming" endpointName="Subscriber"/>
                <endpoint aliasName="outgoing" endpointName="Publisher"/>
            </endpoints>
        </xService>
    </xServices>
</point.Services>
Run Code Online (Sandbox Code Playgroud)

这是我加载它的代码:

public class PointServices : ConfigurationSection
{
    public static PointServices Get()
    {
        var t = (PointServices)ConfigurationManager.GetSection("point.Services/xServices");

        return null;
    }

    //<summary>
    //Declares a collection …
Run Code Online (Sandbox Code Playgroud)

c# configuration app-config configurationsection

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

SQL Server 2008 - 默认列值 - 我应该使用null还是空字符串?

有一段时间我在讨论是否应该留下我不知道数据是否会被传入的列并将值设置为空字符串('')或仅允许空值.

我想听听这里的推荐做法.

如果它有所作为,我使用c#作为消费应用程序.

sql sql-server string null

4
推荐指数
1
解决办法
3511
查看次数

强大的命令行实用程序

任何人都可以向我推荐一个比winXP附带的内置"cmd"窗口更好的命令行实用程序.

任何建议都会有所帮助.如果你支持别人,请投票给别人,这样我就会更好地了解社区的想法.

谢谢

command-prompt

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

Unity [Dependency]属性无法解析

我有以下代码,当我尝试运行它时,我可以看到BrokerProvider没有被解析.这是我的代码:

static void Main(string[] args)
        {
            IUnityContainer container = new UnityContainer();
            UnityConfigurationSection section = (UnityConfigurationSection) ConfigurationManager.GetSection("unity");
            section.Containers.Default.Configure(container);

            new TestBroker().RunTestBroker();              
        }


class TestBroker
    {
        private IBrokerProvider brokerProvider;

        public void RunTestBroker()
        {
            List<IPortfolio> portfolios = BrokerProvider.GetPortfolios();
        }

        [Dependency]
        public IBrokerProvider BrokerProvider
        {
            get { return brokerProvider; }
            set { brokerProvider = value; }
        }
    }
Run Code Online (Sandbox Code Playgroud)

相关配置

 <unity>
    <typeAliases>
      <typeAlias alias="string" type="System.String, mscorlib" />
      <typeAlias alias="singleton" type="Microsoft.Practices.Unity.ContainerControlledLifetimeManager, Microsoft.Practices.Unity" />
      <typeAlias alias="IBrokerProvider" type="PA.Common.Interfaces.IBrokerProvider, PA.Common" />

      <typeAlias alias="PManager" type="PA.BrokerProviders.PManager, PA.BrokerProviders" />
    </typeAliases>
    <containers>
      <container>
        <types> …
Run Code Online (Sandbox Code Playgroud)

unity-container

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

带有消息序列化的 WCF

我正在编写一个简单的 wcf 服务,将请求提交给某个网关进行处理。

正在通过执行以下操作来执行请求:

我正在编写一个 WCF 服务,该服务将请求提交给一些期望得到如下内容的服务:

gatewayService.SendRequest(request);
Run Code Online (Sandbox Code Playgroud)

其中 gatewayService 是 WCF 代理,请求是我自己的对象,它继承了 WCF Message 对象。

请求对象有几个属性,如:

[MessageBodyMember]
public ReportCommandLineRequest ReportRequest { get; set; }

[MessageBodyMember]
public ImportCommandLineRequest ImportRequest { get; set; }
Run Code Online (Sandbox Code Playgroud)

我的问题是当这个请求对象被序列化时。在服务器端,我收到了一条看起来像这样的大块肥皂消息:

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" 
            xmlns:a="http://www.w3.org/2005/08/addressing">
   <s:Header>
      <a:Action s:mustUnderstand="1">http://tempuri.org/IReportClient/RunReport/IGatewayAdapter/SendRequest</a:Action>
      <VsDebuggerCausalityData xmlns="http://schemas.microsoft.com/vstudio/diagnostics/servicemodelsink">uIDPo4jiWNjcsdxHiUhlOA63xYEAAAAApgt+BuVvcEixP33+yOQTgRHZQSyr4L5ImMHVeEWLFBMACQAA</VsDebuggerCausalityData>
      <a:To s:mustUnderstand="1">net.tems://localhost:7222/queue/LB.FIA.Gateway.STAGE.InputQueue</a:To>
   </s:Header>
   <s:Body>
      <SendRequest xmlns="http://tempuri.org/IReportClient/RunReport">
          <request xmlns:b="http://schemas.datacontract.org/2004/07....
Run Code Online (Sandbox Code Playgroud)

另一方面,我希望在服务器端只得到上面列出的属性的序列化(ReportRequest/ImportRequest),并希望得到一个序列化的 xml 看起来像这样(没有里面的所有垃圾:

<ReportCommandLineRequest>
  <outputFileName>gatewayReportOutput-01082010-150043.pdf</outputFileName>
  <CommandLineArg
    name="format"
..
</ReportCommandLineRequest>
Run Code Online (Sandbox Code Playgroud)

谁能帮我弄清楚我该怎么做?

谢谢。

wcf serialization xml-serialization

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

使用Regex解析和替换字符串

我有各种各样的字符串,如下所示:

$(gateway.jms.jndi.ic.url,0,tibjmsnaming, tcp)/topic/$(gateway.destination.prefix)$(gateway.StatusTopicName),$(gateway.jms.jndi.ic.username),$(gateway.jms.jndi.ic.password),abinding,tBinding
Run Code Online (Sandbox Code Playgroud)

我试图找出一种方法来提取$(...)部分并用其他字符串替换它们.

无论如何在C#中解析这些组并用另一个字符串逐个替换?

谢谢

c# regex

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

为什么我的ng模型不绑定?

我有以下html:

<form ng-submit="addPath()">
                <input type="text" ng-model="newPathText"  style="width: 500px;" placeholder="Enter a local or network folder location (e.g., K:\documents\new-york)">
                <input class="btn-primary" type="submit" value="add" style="margin-bottom: 10px">
            </form>
Run Code Online (Sandbox Code Playgroud)

和后面的js代码:

 $scope.addPath = function() {
        $scope.watchedFolders.push($scope.newPathText);
        apiService.addScanPath($scope.newPathText)
        $scope.newPathText= '';
    };
Run Code Online (Sandbox Code Playgroud)

然而,当我调试它并调用addPath()时,我看到'$ scope.newPathText'总是变空('')...我在这里丢失了什么吗?

谢谢

angularjs angularjs-scope

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