Workflow Foundation 编译错误 - 帮助!
我正在开发 WCF 工作流服务应用程序,我只有一个接收活动,该活动从客户端应用程序获取输入,然后将输入传递到远程 Web 服务,计算结果,并将结果返回到客户端站点。
我正在尝试设置远程 Web 服务的结果,但出现以下错误:
处理表达式时遇到编译错误:Option Strict On 不允许 从 Object 到 Double 的隐式转换。
我理解这是什么意思,并且我尝试了一些解决方法。例如,我已将对象设置为字符串,并尝试将其解析为双精度,但得到了相同的结果。
这是我正在寻找的,以提供更好的想法。您可以看到屏幕底部的变量是我尝试将结果设置为的变量。
你可以看到红色错误圈在哪里,就是我的编译错误所在。
I am working on a WCF Workflow Service Application, and I simply have a Receive activity that is taking input from a client application, then passing the input to a remote web service,calculating a result, and returning the result to the client site.
I am attempting to setup the result for the remote web service, but it is giving me the following error:
Compilation error(s) encountered while processing expression:Option Strict On disallows
implicit conversion from Object to Double.
I understand what this is saying, and I have tried a couple work arounds. For example, I have set the Object to string, and attempted to parse it to double, but got the same result.
Here is what I am looking at to give a better idea. You can see the variables on the bottom of the screen are what I am attempting to set the result to.
You can see where the red error circle is, is where my compilation error is.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要解决此问题,variable1 需要是 Double,或者您需要在CalculateMonthlyPaymentResult 赋值中进行显式转换。我投票支持前者,因为它更正确。如果您需要返回双精度值,那么这就是工作流应该使用的数据类型,而不是变量当前定义的对象。
To fix this, variable1 needs to be a Double, or you need to put an explicit cast in the CalculateMonthlyPaymentResult assignment. I vote for the former as it is more correct. If you need to return a double, then that is the data type that the workflow should be working with rather than Object which the variable is current defined as.