+ Start a Discussion

Getting error: The type or namespace 'sforce' could not be found

I'm very new to this and I have a problem getting started. I'm going through the guide and have gotten to the part of walking through the sample code. However, I can't get it to recognize the web reference and I keep getting the error:
The type or namespace 'sforce' could not be found (are you missing a using directive or an assembly reference?)
See screenshot:
I saw a few posts with people having the same problem but no real resolution to it. If anyone can help me get the first part of the sample code working, that'd be great!

Hmmm interesting, try referencing the namespace on top.

using sforce;


I had the same issue and I tried including the "using sforce;" namespace, but I still get the error plus an additional one. Now I get two namespace errors, just as seen in the first poster's image. Any idea?


Look at the generated C# source to see what namespace its in, sometimes it'll be in a sub namespace of your overal project


Thanks for your reply. I figure out the issue. I originally named my project something, then renamed it to fit the example from the dev document. There in lied the problem,  I was calling on a namespace that VS didn't think existed. I looking in the properties of the project to find that namespace was still the original name I started the project under. I change the "using" reference to my original project name and voila! Thanks for your help.