10

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)

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.

Does anyone know what this means?

James Wood
  • 17,286
  • 4
  • 46
  • 89
hello B
  • 891
  • 5
  • 18
  • 41
  • yes, "don't use generic names already taken by CRM". However, Dragos' solution would also work. – Mike_Matthews_II Mar 11 '13 at 19:26
  • Try this solution " Restart Omnisharp" https://stackoverflow.com/questions/48527394/visual-studio-code-intellisense-stopped-to-work-on-c-sharp-files – Samuel JEAN Mar 13 '23 at 19:33

3 Answers3

5

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).

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.

halfer
  • 19,824
  • 17
  • 99
  • 186
Dragos Bobolea
  • 772
  • 7
  • 16
  • I am also having this same issue although i have explicitly specified the namespace but still having this problem. What could be the possible reason in this case? – Furqan Safdar Jul 07 '13 at 13:52
  • And you are 100% positive it's not in the same namespace? What's the conflicting class name? – Dragos Bobolea Jul 08 '13 at 21:01
5

I had two separate resource files in a same solution. Deleting one of them did the trick :P

codegasm
  • 676
  • 1
  • 8
  • 21
2

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.

SteveCav
  • 6,649
  • 1
  • 50
  • 52