THRIFT-1794 C# asyncctp broken
Patch: Carl Yeksigian
diff --git a/compiler/cpp/src/generate/t_csharp_generator.cc b/compiler/cpp/src/generate/t_csharp_generator.cc
index 924d372..943445a 100644
--- a/compiler/cpp/src/generate/t_csharp_generator.cc
+++ b/compiler/cpp/src/generate/t_csharp_generator.cc
@@ -47,10 +47,15 @@
       (void) option_string;
 
       std::map<std::string, std::string>::const_iterator iter;
+
       iter = parsed_options.find("async");
       async_ = (iter != parsed_options.end());
       iter = parsed_options.find("asyncctp");
       async_ctp_ = (iter != parsed_options.end());
+      if (async_ && async_ctp_) {
+        throw "argument error: Cannot specify both async and asyncctp; they are incompatible.";
+      }
+
       iter = parsed_options.find("nullable");
       nullable_ = (iter != parsed_options.end());
 
@@ -982,7 +987,8 @@
     if(async_||async_ctp_) {
       indent(f_service_) <<
         function_signature_async(*f_iter) << ";" << endl;
-    } else {
+    }
+    if (!async_) {
       indent(f_service_) << "#endif" << endl;
     }
   }