Merge pull request #477 from jtattermusch/vsproject_templates

Improving Visual Studio templates
diff --git a/build.json b/build.json
index 22a4045..bbff314 100644
--- a/build.json
+++ b/build.json
@@ -347,7 +347,8 @@
       "deps": [
         "gpr",
         "grpc"
-      ]
+      ],
+      "vs_project_guid": "{D64C6D63-4458-4A88-AB38-35678384A7E4}"
     },
     {
       "name": "grpc_test_util",
diff --git a/templates/vsprojects/vs2013/gpr.vcxproj.filters.template b/templates/vsprojects/vs2013/gpr.vcxproj.filters.template
index 0ed1ed8..c8b2ce0 100644
--- a/templates/vsprojects/vs2013/gpr.vcxproj.filters.template
+++ b/templates/vsprojects/vs2013/gpr.vcxproj.filters.template
@@ -1,2 +1,2 @@
-<%namespace file="vcxproj.filters_defs.include" import="gen_project"/>\
-${gen_project('gpr', libs, targets)}
+<%namespace file="vcxproj.filters_defs.include" import="gen_filters"/>\
+${gen_filters('gpr', libs, targets)}
diff --git a/templates/vsprojects/vs2013/grpc.vcxproj.filters.template b/templates/vsprojects/vs2013/grpc.vcxproj.filters.template
index 0327c94..b8e91bd 100644
--- a/templates/vsprojects/vs2013/grpc.vcxproj.filters.template
+++ b/templates/vsprojects/vs2013/grpc.vcxproj.filters.template
@@ -1,2 +1,2 @@
-<%namespace file="vcxproj.filters_defs.include" import="gen_project"/>\
-${gen_project('grpc', libs, targets)}
+<%namespace file="vcxproj.filters_defs.include" import="gen_filters"/>\
+${gen_filters('grpc', libs, targets)}
diff --git a/templates/vsprojects/vs2013/grpc_csharp_ext.vcxproj.template b/templates/vsprojects/vs2013/grpc_csharp_ext.vcxproj.template
new file mode 100644
index 0000000..84aa502
--- /dev/null
+++ b/templates/vsprojects/vs2013/grpc_csharp_ext.vcxproj.template
@@ -0,0 +1,2 @@
+<%namespace file="vcxproj_defs.include" import="gen_project"/>\
+${gen_project('grpc_csharp_ext', libs, targets)}
diff --git a/templates/vsprojects/vs2013/grpc_unsecure.vcxproj.filters.template b/templates/vsprojects/vs2013/grpc_unsecure.vcxproj.filters.template
index 48cbbd3..ef91892 100644
--- a/templates/vsprojects/vs2013/grpc_unsecure.vcxproj.filters.template
+++ b/templates/vsprojects/vs2013/grpc_unsecure.vcxproj.filters.template
@@ -1,2 +1,2 @@
-<%namespace file="vcxproj.filters_defs.include" import="gen_project"/>\
-${gen_project('grpc_unsecure', libs, targets)}
+<%namespace file="vcxproj.filters_defs.include" import="gen_filters"/>\
+${gen_filters('grpc_unsecure', libs, targets)}
diff --git a/templates/vsprojects/vs2013/grpc_unsecure.vcxproj.template b/templates/vsprojects/vs2013/grpc_unsecure.vcxproj.template
index 3de6453..4f62b85 100644
--- a/templates/vsprojects/vs2013/grpc_unsecure.vcxproj.template
+++ b/templates/vsprojects/vs2013/grpc_unsecure.vcxproj.template
@@ -1,2 +1,2 @@
 <%namespace file="vcxproj_defs.include" import="gen_project"/>\
-${gen_project('grpc', libs, targets)}
\ No newline at end of file
+${gen_project('grpc_unsecure', libs, targets)}
\ No newline at end of file
diff --git a/templates/vsprojects/vs2013/vcxproj.filters_defs.include b/templates/vsprojects/vs2013/vcxproj.filters_defs.include
index c25718b..539ae93 100644
--- a/templates/vsprojects/vs2013/vcxproj.filters_defs.include
+++ b/templates/vsprojects/vs2013/vcxproj.filters_defs.include
@@ -8,7 +8,7 @@
 <%def name="to_windows_path(path)">${path.replace('/','\\')}</%def>\
 <%def name="to_filter(path)">${calc_to_filter(path)}</%def>\
 <%def name="filter_to_guid(proj, filter)">${re.sub('(........)(....)(....)(....)', r'\1-\2-\3-\4-', hashlib.md5(''.join([filter, proj])).hexdigest())}</%def>\
-<%def name="gen_project(name, libs, targets)">\
+<%def name="gen_filters(name, libs, targets)">\
 % for project in vsprojects:
   % if project.name == name:
 <?xml version="1.0" encoding="utf-8"?>
diff --git a/vsprojects/vs2013/.gitignore b/vsprojects/vs2013/.gitignore
index 75fb4ed..304acf0 100644
--- a/vsprojects/vs2013/.gitignore
+++ b/vsprojects/vs2013/.gitignore
@@ -1,5 +1,8 @@
 Debug
 Release
 *.suo
+*.user
+test_bin
 grpc.opensdf
 grpc.sdf
+third_party/*.user
diff --git a/vsprojects/vs2013/grpc.sln b/vsprojects/vs2013/grpc.sln
index 9b3ebaf..efc4725 100644
--- a/vsprojects/vs2013/grpc.sln
+++ b/vsprojects/vs2013/grpc.sln
@@ -12,6 +12,12 @@
 		{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}
 	EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_csharp_ext", "grpc_csharp_ext.vcxproj", "{D64C6D63-4458-4A88-AB38-35678384A7E4}"
+	ProjectSection(ProjectDependencies) = postProject
+		{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}
+		{29D16885-7228-4C31-81ED-5F9187C7F2A9} = {29D16885-7228-4C31-81ED-5F9187C7F2A9}
+	EndProjectSection
+EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_test_util", "grpc_test_util.vcxproj", "{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_unsecure", "grpc_unsecure.vcxproj", "{46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}"
@@ -41,6 +47,10 @@
 		{29D16885-7228-4C31-81ED-5F9187C7F2A9}.Debug|Win32.Build.0 = Debug|Win32
 		{29D16885-7228-4C31-81ED-5F9187C7F2A9}.Release|Win32.ActiveCfg = Release|Win32
 		{29D16885-7228-4C31-81ED-5F9187C7F2A9}.Release|Win32.Build.0 = Release|Win32
+		{D64C6D63-4458-4A88-AB38-35678384A7E4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D64C6D63-4458-4A88-AB38-35678384A7E4}.Debug|Win32.Build.0 = Debug|Win32
+		{D64C6D63-4458-4A88-AB38-35678384A7E4}.Release|Win32.ActiveCfg = Release|Win32
+		{D64C6D63-4458-4A88-AB38-35678384A7E4}.Release|Win32.Build.0 = Release|Win32
 		{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}.Debug|Win32.ActiveCfg = Debug|Win32
 		{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}.Debug|Win32.Build.0 = Debug|Win32
 		{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}.Release|Win32.ActiveCfg = Release|Win32
diff --git a/vsprojects/vs2013/grpc_csharp_ext.vcxproj b/vsprojects/vs2013/grpc_csharp_ext.vcxproj
new file mode 100644
index 0000000..0f35566
--- /dev/null
+++ b/vsprojects/vs2013/grpc_csharp_ext.vcxproj
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{D64C6D63-4458-4A88-AB38-35678384A7E4}</ProjectGuid>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v120</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+    <IntDir>$(Configuration)\$(ProjectName)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v120</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+    <IntDir>$(Configuration)\$(ProjectName)\</IntDir>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="global.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="global.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup />
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\csharp\ext\grpc_csharp_ext.c">
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="gpr.vcxproj">
+      <Project>{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}</Project>
+    </ProjectReference>
+    <ProjectReference Include="grpc.vcxproj">
+      <Project>{29D16885-7228-4C31-81ED-5F9187C7F2A9}</Project>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
+
diff --git a/vsprojects/vs2013/grpc_unsecure.vcxproj b/vsprojects/vs2013/grpc_unsecure.vcxproj
index 12428bd..3dab86c 100644
--- a/vsprojects/vs2013/grpc_unsecure.vcxproj
+++ b/vsprojects/vs2013/grpc_unsecure.vcxproj
@@ -11,7 +11,7 @@
     </ProjectConfiguration>
   </ItemGroup>
   <PropertyGroup Label="Globals">
-    <ProjectGuid>{29D16885-7228-4C31-81ED-5F9187C7F2A9}</ProjectGuid>
+    <ProjectGuid>{46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}</ProjectGuid>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@@ -73,24 +73,12 @@
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClInclude Include="..\..\include\grpc\grpc_security.h" />
     <ClInclude Include="..\..\include\grpc\byte_buffer.h" />
     <ClInclude Include="..\..\include\grpc\byte_buffer_reader.h" />
     <ClInclude Include="..\..\include\grpc\grpc.h" />
     <ClInclude Include="..\..\include\grpc\status.h" />
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="..\..\src\core\security\auth.h" />
-    <ClInclude Include="..\..\src\core\security\base64.h" />
-    <ClInclude Include="..\..\src\core\security\credentials.h" />
-    <ClInclude Include="..\..\src\core\security\google_root_certs.h" />
-    <ClInclude Include="..\..\src\core\security\json_token.h" />
-    <ClInclude Include="..\..\src\core\security\secure_transport_setup.h" />
-    <ClInclude Include="..\..\src\core\security\security_context.h" />
-    <ClInclude Include="..\..\src\core\tsi\fake_transport_security.h" />
-    <ClInclude Include="..\..\src\core\tsi\ssl_transport_security.h" />
-    <ClInclude Include="..\..\src\core\tsi\transport_security.h" />
-    <ClInclude Include="..\..\src\core\tsi\transport_security_interface.h" />
     <ClInclude Include="..\..\src\core\channel\census_filter.h" />
     <ClInclude Include="..\..\src\core\channel\channel_args.h" />
     <ClInclude Include="..\..\src\core\channel\channel_stack.h" />
@@ -182,32 +170,6 @@
     <ClInclude Include="..\..\src\core\transport\transport_impl.h" />
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="..\..\src\core\security\auth.c">
-    </ClCompile>
-    <ClCompile Include="..\..\src\core\security\base64.c">
-    </ClCompile>
-    <ClCompile Include="..\..\src\core\security\credentials.c">
-    </ClCompile>
-    <ClCompile Include="..\..\src\core\security\factories.c">
-    </ClCompile>
-    <ClCompile Include="..\..\src\core\security\google_root_certs.c">
-    </ClCompile>
-    <ClCompile Include="..\..\src\core\security\json_token.c">
-    </ClCompile>
-    <ClCompile Include="..\..\src\core\security\secure_endpoint.c">
-    </ClCompile>
-    <ClCompile Include="..\..\src\core\security\secure_transport_setup.c">
-    </ClCompile>
-    <ClCompile Include="..\..\src\core\security\security_context.c">
-    </ClCompile>
-    <ClCompile Include="..\..\src\core\security\server_secure_chttp2.c">
-    </ClCompile>
-    <ClCompile Include="..\..\src\core\tsi\fake_transport_security.c">
-    </ClCompile>
-    <ClCompile Include="..\..\src\core\tsi\ssl_transport_security.c">
-    </ClCompile>
-    <ClCompile Include="..\..\src\core\tsi\transport_security.c">
-    </ClCompile>
     <ClCompile Include="..\..\src\core\channel\call_op_string.c">
     </ClCompile>
     <ClCompile Include="..\..\src\core\channel\census_filter.c">