Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.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
Wcf 输入字符串的格式不正确_Wcf - Fatal编程技术网

Wcf 输入字符串的格式不正确

Wcf 输入字符串的格式不正确,wcf,Wcf,我只是创建了一个wcf服务,它正在打印“hello world”。创建了顺序控制台工作流,向工作流中添加了发送活动和代码活动。此处引用了该服务。已配置发送活动。已为返回值创建依赖项属性 现在当我运行应用程序时。它在行的program.cs文件中抛出格式异常 WorkflowInstance instance = workflowRuntime.CreateWorkflow(typeof(Using_SendActivity.Workflow1)); 我哪里出错了 System.FormatEx

我只是创建了一个wcf服务,它正在打印“hello world”。创建了顺序控制台工作流,向工作流中添加了发送活动和代码活动。此处引用了该服务。已配置发送活动。已为返回值创建依赖项属性

现在当我运行应用程序时。它在行的
program.cs
文件中抛出格式异常

WorkflowInstance instance = workflowRuntime.CreateWorkflow(typeof(Using_SendActivity.Workflow1));
我哪里出错了

System.FormatException was unhandled
  Message="Input string was not in a correct format."
  Source="mscorlib"
  StackTrace:
       at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
       at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
       at System.Int32.Parse(String s, IFormatProvider provider)
       at System.Diagnostics.PerformanceCounterLib.GetStringTable(Boolean isHelp)
       at System.Diagnostics.PerformanceCounterLib.get_NameTable()
       at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
       at System.Diagnostics.PerformanceCounterLib.CategoryExists(String machine, String category)
       at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName, String machineName)
       at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName)
       at System.Workflow.Runtime.PerformanceCounterManager.SetInstanceName(String instanceName)
       at System.Workflow.Runtime.WorkflowRuntime.StartRuntime()
       at System.Workflow.Runtime.WorkflowRuntime.InternalCreateWorkflow(CreationContext context, Guid instanceId)
       at System.Workflow.Runtime.WorkflowRuntime.CreateWorkflow(Type workflowType)
       at Using_SendActivity.Program.Main(String[] args) in C:\Documents and Settings\as73043\My Documents\Visual Studio 2008\Projects\Using SendActivity\Using SendActivity\Program.cs:line 28
  InnerException: 
我正在使用的wcf文件:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WcfServiceForSendActivity
{
    // NOTE: If you change the class name "Service1" here, you must also update the reference to "Service1" in App.config.
    public class Service1 : IService1
    {
        #region IMyService Members

        public string GetResponse()
        {
            return string.Format("Hello World !!!");
        }

        #endregion

    }
}

在Win7上,从提升的命令提示符运行“lodctr/R”,然后重新启动以重新加载性能计数器

此知识库提供了有关旧操作系统的更多详细信息。

有关类似的例外情况,请参阅

解决方案是执行注册表清理,解释如下:

错误在于未能发布完整的异常,包括堆栈跟踪和所有内部异常。这样做,你就有机会得到答案。您甚至可能需要发布一些代码。