Reputation: 2039
I've defined a lot of types and methods (messages and services in proto-lingo) and got stuck on this problem. Sometimes when I make changes I get this very unhelpful error message.
The type of namespace name "Fault" does not exist in the namespace 'MyApp.MyDomain' (are you missing an assembly reference?)
I'm using Visual Studio 2017 and compile to C#.
Upvotes: 1
Views: 3133
Reputation: 1777
I ran into this but in my situation, I had an import statement. The import statement is case sensitive.
"project/myClass/v1/mytest.proto" => "project/myClass/v1/myTest.proto"
Upvotes: 0
Reputation: 2039
I'm answering my own question because I get a feeling this is a common problem. It's also hard enough to figure out because the error message is (although helpful) very general. I.e you get the same error message all the time for various reasons.
The solution was to set the "Build Action"-property for each .proto file to build using the protobuf compiler.
Do this:
Your .cs files should now be generated in your folder ./project/MyProject/obj/Debug/netstandard2.0/
folder (or similar destination folder).
Upvotes: 5