Skip to content
This repository was archived by the owner on Oct 3, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions samples/core-DirectLine/DirectLineBot/DirectLineBot.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.7.0" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.11.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.10" />
</ItemGroup>

<ItemGroup>
Expand Down
18 changes: 9 additions & 9 deletions samples/core-DirectLine/DirectLineBot/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public Startup(IConfiguration configuration)
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
services.AddControllers().AddNewtonsoftJson();

// Create the Bot Framework Adapter with error handling enabled.
services.AddSingleton<IBotFrameworkHttpAdapter, AdapterWithErrorHandler>();
Expand All @@ -43,16 +43,16 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseHsts();
}

app.UseDefaultFiles();
app.UseStaticFiles();
app.UseWebSockets();
app.UseDefaultFiles()
.UseStaticFiles()
.UseRouting()
.UseAuthorization()
.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
//app.UseHttpsRedirection();
app.UseMvc();
}
}
}
18 changes: 0 additions & 18 deletions samples/core-DirectLine/DirectLineClient/App.config

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,77 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{10935995-5C58-438B-B5F0-FA94BEA2667F}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DirectLineSampleClient</RootNamespace>
<AssemblyName>DirectLineSampleClient</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>8.0</LangVersion>
<VersionPrefix>0.9.0</VersionPrefix>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
<Reference Include="Microsoft.Bot.Connector.DirectLine, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bot.Connector.DirectLine.3.0.1\lib\net45\Microsoft.Bot.Connector.DirectLine.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Rest.ClientRuntime.2.3.4\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.11.1" />
<PackageReference Include="Microsoft.Bot.Connector.DirectLine" Version="3.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="3.1.10" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.10" />
<PackageReference Include="MongoDB.Driver" Version="2.11.4" />
</ItemGroup>

<ItemGroup>
<Compile Include="Models\DirectLineCardContent.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Folder Include="Properties\" />
</ItemGroup>

<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>


</Project>
14 changes: 10 additions & 4 deletions samples/core-DirectLine/DirectLineClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,27 @@
{
using System;
using System.Configuration;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Bot.Connector.DirectLine;
using Models;
using Newtonsoft.Json;
using Microsoft.Extensions.Configuration;

public class Program
{
private static string directLineSecret = ConfigurationManager.AppSettings["DirectLineSecret"];
private static string botId = ConfigurationManager.AppSettings["BotId"];
private static string directLineSecret;
private static string botId;
private static string fromUser = "DirectLineSampleClientUser";

public static void Main(string[] args)
{
IConfiguration configuration = new ConfigurationBuilder()
.AddJsonFile("appsettings.json", true, true)
.Build();

directLineSecret = configuration.GetValue<string>("DirectLineSecret");
botId= configuration.GetValue<string>("BotId");
StartBotConversation().Wait();
}

Expand Down Expand Up @@ -85,7 +91,7 @@ private static async Task ReadBotMessagesAsync(DirectLineClient client, string c
case "image/png":
Console.WriteLine($"Opening the requested image '{attachment.ContentUrl}'");

Process.Start(attachment.ContentUrl);
System.Diagnostics.Process.Start(attachment.ContentUrl);
break;
}
}
Expand Down

This file was deleted.

4 changes: 4 additions & 0 deletions samples/core-DirectLine/DirectLineClient/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"BotId": "",
"DirectLineSecret": ""
}
6 changes: 0 additions & 6 deletions samples/core-DirectLine/DirectLineClient/packages.config

This file was deleted.

2 changes: 1 addition & 1 deletion samples/core-DirectLine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A sample bot and a custom client communicating to each other using the Direct Li
### Prerequisites

The minimum prerequisites to run this sample are:
* The latest update of Visual Studio 2017. You can download the community version [here](http://www.visualstudio.com) for free.
* The latest update of Visual Studio 2019. You can download the community version [here](http://www.visualstudio.com) for free.
* The Bot Framework Emulator. To install the Bot Framework Emulator, download it from [here](https://emulator.botframework.com/). Please refer to [this documentation article](https://github.com/microsoft/botframework-emulator/wiki/Getting-Started) to know more about the Bot Framework Emulator.
* Register your bot with the Microsoft Bot Framework. Please refer to [this](https://docs.microsoft.com/en-us/bot-framework/portal-register-bot) for the instructions. Once you complete the registration, update the [Bot's appsettings.json](DirectLineBot/appsettings.json) file with the registered config values (MicrosoftAppId and MicrosoftAppPassword)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.9.1" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.11.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.10" />
</ItemGroup>

<ItemGroup>
<ItemGroup>
<Content Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>


</Project>
18 changes: 9 additions & 9 deletions samples/core-DirectLineWebSockets/DirectLineBot/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public Startup(IConfiguration configuration)
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
services.AddControllers().AddNewtonsoftJson();

// Create the Bot Framework Adapter with error handling enabled.
services.AddSingleton<IBotFrameworkHttpAdapter, AdapterWithErrorHandler>();
Expand All @@ -43,16 +43,16 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseHsts();
}

app.UseDefaultFiles();
app.UseStaticFiles();
app.UseWebSockets();
app.UseDefaultFiles()
.UseStaticFiles()
.UseRouting()
.UseAuthorization()
.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
//app.UseHttpsRedirection();
app.UseMvc();
}
}
}