Skip to content

Commit 447028b

Browse files
committed
samples and generator updates for 4.4 release
- update all samples, all languages, all platforms - update VSIX and yeoman code generators - add .NET Templates - update master README.md - update SPEC.md - update INSTALLING_CLI_TOOLS.md
1 parent d63f981 commit 447028b

File tree

1,686 files changed

+44393
-123319
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,686 files changed

+44393
-123319
lines changed

INSTALLING_CLI_TOOLS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ The Bot Framework now has CLI tools to help quickly create bots and bot-specific
1313
| [![npm version](https://badge.fury.io/js/luisgen.svg)](https://badge.fury.io/js/luisgen)| [LUISGen](packages/LUISGen) | Auto generate backing C#/Typescript classes for your LUIS intents and entities.|
1414

1515
## Install CLI tools:
16-
Pre-requisites:
17-
- [Node.js](https://nodejs.org/) version 8.5 or higher
18-
- [dotnetcore 2.0](https://www.microsoft.com/net/download/dotnet-core/2.0) for `luisgen` and `botdispatch`
16+
Pre-requisites:
17+
- [Node.js](https://nodejs.org/) version 10.14 or higher
18+
- [dotnetcore 2.1](https://www.microsoft.com/net/download/dotnet-core/2.1) for `luisgen` and `botdispatch`
1919

2020
Windows users can type the following into their CLI to install the tools:
2121
```bash

README.md

Lines changed: 36 additions & 111 deletions
Large diffs are not rendered by default.

SPEC.md

Lines changed: 81 additions & 287 deletions
Large diffs are not rendered by default.

generators/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
## Overview
1+
# Overview
22

33
This folder contains code generators for Microsoft **Bot Framework V4 SDK** - [dotnet SDK][10], [JS SDK][11].
44

55
Currently there are three code generator options to choose from. They are:
66

7-
# Supported Code Generators
7+
## Supported Code Generators
8+
89
| Generator | Language Support | OS Support |
910
| --------- | ---------------- | ---------- |
1011
| [.NET Core SDK Templates][1] | C# | `dotnet new` for Windows, macOS, Linux |
1112
| [Yeoman Generator][2] | Javascript, TypeScript | Windows, macOS, Linux |
1213
| [Visual Studio Extension][3] | C# | Visual Studio for Windows |
1314

14-
# Help Me Choose a Generator
15+
## Help Me Choose a Generator
16+
1517
Which code generator to use largely depends on the development tools and programming language you use. The table below can help you decide:
1618

1719
| Language | Programming Editor | OS Support | Code Generator |

generators/dotnet-templates/Microsoft.BotFramework.CSharp.CoreBot/Microsoft.BotFramework.CSharp.CoreBot.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
33
<metadata>
44
<id>Microsoft.BotFramework.CSharp.CoreBot</id>
5-
<version>0.1.6</version>
5+
<version>0.4.6</version>
66
<description>
77
A .NET Core Template for Microsoft Bot Framework v4. Will let you quickly set up a conversational AI bot with core features every bot is likely to have.
88
</description>

generators/dotnet-templates/Microsoft.BotFramework.CSharp.CoreBot/content/.template.config/template.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"defaultName": "CoreBot",
1111
"groupIdentity": "Microsoft.BotFramework.CSharp.CoreBot",
1212
"identity": "Microsoft.BotFramework.CSharp.CoreBot",
13-
"name": "Bot Framework Core Bot (v0.1.6)",
13+
"name": "Bot Framework Core Bot (v0.4.6)",
1414
"preferNameDirectory": true,
15-
"sourceName": "Microsoft.BotFramework.Samples",
15+
"sourceName": "Microsoft.BotFramework.CoreBot",
1616
"shortName": "corebot",
1717
"tags": {
1818
"language": "C#",
@@ -24,15 +24,20 @@
2424
"type": "generated",
2525
"generator": "constant",
2626
"parameters": {
27-
"value": "v0.1.6"
27+
"value": "v0.4.6"
2828
},
29-
"replaces": "vX.X.X"
29+
"replaces": "__vX.X.X__"
3030
},
3131
"output": {
3232
"type": "parameter",
3333
"replaces": "{OUTPUT_PATH}",
3434
"defaultValue": "CoreBot"
3535
},
36+
"name": {
37+
"type": "parameter",
38+
"replaces": "__PROJECT_NAME__",
39+
"defaultValue": "CoreBot"
40+
},
3641
"Framework": {
3742
"type": "parameter",
3843
"description": "The target framework for the project.",
@@ -45,10 +50,6 @@
4550
{
4651
"choice": "netcoreapp2.1",
4752
"description": "Target netcoreapp2.1"
48-
},
49-
{
50-
"choice": "netcoreapp2.0",
51-
"description": "Target netcoreapp2.0"
5253
}
5354
],
5455
"replaces": "__NETCOREAPP_VERSION__",
@@ -64,38 +65,30 @@
6465
"cases": [
6566
{
6667
"condition": "(Framework==\"netcoreapp2.2\")",
67-
"value": "\"Microsoft.AspNetCore\" Version=\"2.2.0\""
68+
"value": "'Microsoft.AspNetCore' Version='2.2.0'"
6869
},
6970
{
7071
"condition": "(Framework==\"netcoreapp2.1\")",
71-
"value": "\"Microsoft.AspNetCore\" Version=\"2.1.6\""
72-
},
73-
{
74-
"condition": "(Framework==\"netcoreapp2.0\")",
75-
"value": "\"Microsoft.AspNetCore\" Version=\"2.0.4\""
72+
"value": "'Microsoft.AspNetCore' Version='2.1.6'"
7673
}
7774
]
7875
}
7976
},
80-
"AspCoreAllAssemblyVersion": {
77+
"ReadmeNetCorePrereqVersion": {
8178
"type":"generated",
8279
"generator": "switch",
8380
"dataType": "string",
84-
"replaces": "__MICROSOFT_ASPNETCORE_ALL_VERSION__",
81+
"replaces": "__NETCORE_VERSION__",
8582
"parameters": {
8683
"evaluator": "C++",
8784
"cases": [
8885
{
8986
"condition": "(Framework==\"netcoreapp2.2\")",
90-
"value": "\"Microsoft.AspNetCore.All\""
87+
"value": "2.2"
9188
},
9289
{
9390
"condition": "(Framework==\"netcoreapp2.1\")",
94-
"value": "\"Microsoft.AspNetCore.All\""
95-
},
96-
{
97-
"condition": "(Framework==\"netcoreapp2.0\")",
98-
"value": "\"Microsoft.AspNetCore.All\" Version=\"2.0.9\""
91+
"value": "2.1"
9992
}
10093
]
10194
}
@@ -108,6 +101,13 @@
108101
"isRequired": false
109102
}
110103
},
104+
"sources": [
105+
{
106+
"modifiers": [
107+
{"exclude": [ "**/NuGet.Config", "**/.DS_Store" ]}
108+
]
109+
}
110+
],
111111
"postActions": [
112112
{
113113
"condition": "(!SkipRestore)",

generators/dotnet-templates/Microsoft.BotFramework.CSharp.CoreBot/content/.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"request": "launch",
1111
"preLaunchTask": "build",
1212
// If you have changed target frameworks, make sure to update the program path.
13-
"program": "${workspaceFolder}/bin/Debug/netcoreapp2.2/CoreBot.dll",
13+
"program": "${workspaceFolder}/bin/Debug/netcoreapp__NETCORE_VERSION__/__PROJECT_NAME__.dll",
1414
"args": [],
1515
"cwd": "${workspaceFolder}",
1616
"stopAtEntry": false,
@@ -43,4 +43,4 @@
4343
"processId": "${command:pickProcess}"
4444
}
4545
]
46-
}
46+
}

generators/dotnet-templates/Microsoft.BotFramework.CSharp.CoreBot/content/.vscode/tasks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"type": "process",
1212
"args": [
1313
"build",
14-
"${workspaceFolder}/CoreBot.csproj"
14+
"${workspaceFolder}/__PROJECT_NAME__.csproj"
1515
],
1616
"problemMatcher": "$msCompile"
1717
}
1818
]
19-
}
19+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
//
4+
// Generated with CoreBot .NET Template version __vX.X.X__
5+
6+
using System;
7+
using Microsoft.Bot.Builder;
8+
using Microsoft.Bot.Builder.Integration.AspNet.Core;
9+
using Microsoft.Bot.Connector.Authentication;
10+
using Microsoft.Extensions.Logging;
11+
12+
namespace __PROJECT_NAME__
13+
{
14+
public class AdapterWithErrorHandler : BotFrameworkHttpAdapter
15+
{
16+
public AdapterWithErrorHandler(ICredentialProvider credentialProvider, ILogger<BotFrameworkHttpAdapter> logger, ConversationState conversationState = null)
17+
: base(credentialProvider)
18+
{
19+
OnTurnError = async (turnContext, exception) =>
20+
{
21+
// Log any leaked exception from the application.
22+
logger.LogError($"Exception caught : {exception.Message}");
23+
24+
// Send a catch-all appology to the user.
25+
await turnContext.SendActivityAsync("Sorry, it looks like something went wrong.");
26+
27+
if (conversationState != null)
28+
{
29+
try
30+
{
31+
// Delete the conversationState for the current conversation to prevent the
32+
// bot from getting stuck in a error-loop caused by being in a bad state.
33+
// ConversationState should be thought of as similar to "cookie-state" in a Web pages.
34+
await conversationState.DeleteAsync(turnContext);
35+
}
36+
catch (Exception e)
37+
{
38+
logger.LogError($"Exception caught on attempting to Delete ConversationState : {e.Message}");
39+
}
40+
}
41+
};
42+
}
43+
}
44+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
//
4+
// Generated with CoreBot .NET Template version __vX.X.X__
5+
6+
namespace __PROJECT_NAME__
7+
{
8+
public class BookingDetails
9+
{
10+
public string Destination { get; set; }
11+
12+
public string Origin { get; set; }
13+
14+
public string TravelDate { get; set; }
15+
}
16+
}

0 commit comments

Comments
 (0)