C# 命名空间“<全局命名空间>”已包含“工作流”的定义
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15267981/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
The namespace '<global namespace>' already contains a definition for 'Workflow'
提问by hello B
I'm working on a Custom workflow activity. I've created my own helper.cs (Early Bound Entity Classes) with the Code Generation Tool (CrmSvcUtil.exe)
我正在处理自定义工作流活动。我已经使用代码生成工具 (CrmSvcUtil.exe) 创建了自己的 helper.cs(早期绑定实体类)
When I try to compile the code, it returns the following error:
当我尝试编译代码时,它返回以下错误:
The namespace '' already contains a definition for 'Workflow'
命名空间“”已包含“工作流”的定义
From the Helper.cs file.
来自 Helper.cs 文件。
Does anyone know what this means?
有谁知道这是什么意思?
采纳答案by Dragos Bobolea
I suggest you put all the early bound classes in a namespace, so it won't mess up with your other classes. You can specify the namespace with the "/namespace:" parameter for CrmSvcUtil. I usually put the early bound classes in my DataAccess namespace, together with the crm connection classes (Service/ServiceContext wrappers).
我建议您将所有早期绑定的类放在一个命名空间中,这样它就不会与您的其他类混淆。您可以使用 CrmSvcUtil 的“/namespace:”参数指定命名空间。我通常将早期绑定的类与 crm 连接类(Service/ServiceContext 包装器)一起放在我的 DataAccess 命名空间中。
That being said, naming your custom workflow step "Workflow" is not really the best thing to do(if that's what you did, at least so I understood). Try capturing the essence of what the step does into the name - like a title.
话虽如此,将您的自定义工作流程步骤命名为“工作流程”并不是最好的做法(如果您就是这样做的,至少我是这样理解的)。尝试将步骤所做的事情的本质捕捉到名称中 - 就像标题一样。
回答by codegasm
I had two separate resource files in a same solution. Deleting one of them did the trick :P
我在同一个解决方案中有两个单独的资源文件。删除其中一个就行了:P
回答by SteveCav
Just got this because I thought it would be a great idea to copy all the contents of App_Code into App_Code\bkup before deploying a change. Erm, no.
刚刚得到这个是因为我认为在部署更改之前将 App_Code 的所有内容复制到 App_Code\bkup 是一个好主意。嗯,没有。