Skip to content

Commit dfed98c

Browse files
authored
Merge pull request #14947 from OfficeDev/yuqzho/vs-dotnet-fix
2 parents accb8b7 + e2e8fac commit dfed98c

File tree

27 files changed

+137
-105
lines changed

27 files changed

+137
-105
lines changed

templates/vs/csharp/basic-tab/{{ProjectName}}.csproj.tpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<TargetFramework>{{TargetFramework}}</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
7-
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
87
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
98
</PropertyGroup>
109

@@ -57,6 +56,9 @@
5756

5857
<!-- Dynamically include built frontend files as embedded resources after npm build -->
5958
<Target Name="IncludeFrontendAssets" AfterTargets="NpmBuild" BeforeTargets="BeforeBuild">
59+
<PropertyGroup>
60+
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
61+
</PropertyGroup>
6062
<ItemGroup>
6163
<EmbeddedResource Include="Web\bin\**" />
6264
</ItemGroup>

templates/vs/csharp/custom-copilot-basic/.{{NewProjectTypeName}}/launchSettings.json.tpl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,27 @@
88
"M365_AGENTS_PLAYGROUND_TARGET_SDK": "teams-ai-v2-dotnet"
99
},
1010
"launchTestTool": true,
11-
"launchUrl": "http://localhost:56150",
11+
"launchUrl": "http://localhost:56150"
1212
},
1313
// Launch project within Teams
1414
"Microsoft Teams (browser)": {
1515
"commandName": "Project",
16-
"launchUrl": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&appTenantId=${{TEAMS_APP_TENANT_ID}}&login_hint=${{TEAMSFX_M365_USER_NAME}}",
16+
"launchUrl": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&appTenantId=${{TEAMS_APP_TENANT_ID}}&login_hint=${{TEAMSFX_M365_USER_NAME}}"
1717
},
1818
// Launch project within Teams without prepare app dependencies
19+
{{^CEAEnabled}}
1920
"Microsoft Teams (browser) (skip update app)": {
2021
"commandName": "Project",
2122
"environmentVariables": { "UPDATE_TEAMS_APP": "false" },
2223
"launchUrl": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&appTenantId=${{TEAMS_APP_TENANT_ID}}&login_hint=${{TEAMSFX_M365_USER_NAME}}"
23-
},
24+
}
25+
{{/CEAEnabled}}
2426
{{#CEAEnabled}}
27+
"Microsoft Teams (browser) (skip update app)": {
28+
"commandName": "Project",
29+
"environmentVariables": { "UPDATE_TEAMS_APP": "false" },
30+
"launchUrl": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&appTenantId=${{TEAMS_APP_TENANT_ID}}&login_hint=${{TEAMSFX_M365_USER_NAME}}"
31+
},
2532
// Launch project within M365 Copilot
2633
"Microsoft 365 Copilot (browser)": {
2734
"commandName": "Project",
@@ -32,7 +39,7 @@
3239
"commandName": "Project",
3340
"environmentVariables": { "UPDATE_TEAMS_APP": "false" },
3441
"launchUrl": "https://m365.cloud.microsoft/chat/entity1-d870f6cd-4aa5-4d42-9626-ab690c041429/${{AGENT_HINT}}?auth=2"
35-
},
42+
}
3643
{{/CEAEnabled}}
3744
}
3845
}

templates/vs/csharp/custom-copilot-basic/Config.cs.tpl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,29 @@ namespace {{SafeProjectName}}
22
{
33
public class ConfigOptions
44
{
5-
public TeamsConfigOptions Teams { get; set; }
5+
public TeamsConfigOptions Teams { get; set; } = new();
66
{{#useOpenAI}}
7-
public OpenAIConfigOptions OpenAI { get; set; }
7+
public OpenAIConfigOptions OpenAI { get; set; } = new();
88
{{/useOpenAI}}
99
{{#useAzureOpenAI}}
10-
public AzureConfigOptions Azure { get; set; }
10+
public AzureConfigOptions Azure { get; set; } = new();
1111
{{/useAzureOpenAI}}
1212
}
1313

1414
public class TeamsConfigOptions
1515
{
16-
public string BotType { get; set; }
17-
public string ClientId { get; set; }
18-
public string ClientSecret { get; set; }
19-
public string TenantId { get; set; }
16+
public string? BotType { get; set; }
17+
public string? ClientId { get; set; }
18+
public string? ClientSecret { get; set; }
19+
public string? TenantId { get; set; }
2020
}
2121
{{#useOpenAI}}
2222
/// <summary>
2323
/// Options for Open AI
2424
/// </summary>
2525
public class OpenAIConfigOptions
2626
{
27-
public string ApiKey { get; set; }
27+
public string ApiKey { get; set; } = string.Empty;
2828
public string DefaultModel = "gpt-3.5-turbo";
2929
}
3030
{{/useOpenAI}}
@@ -34,9 +34,9 @@ namespace {{SafeProjectName}}
3434
/// </summary>
3535
public class AzureConfigOptions
3636
{
37-
public string OpenAIApiKey { get; set; }
38-
public string OpenAIEndpoint { get; set; }
39-
public string OpenAIDeploymentName { get; set; }
37+
public string OpenAIApiKey { get; set; } = string.Empty;
38+
public string OpenAIEndpoint { get; set; } = string.Empty;
39+
public string OpenAIDeploymentName { get; set; } = string.Empty;
4040
}
4141
{{/useAzureOpenAI}}
4242
}

templates/vs/csharp/custom-copilot-basic/Properties/launchSettings.json.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"ASPNETCORE_ENVIRONMENT": "Development"
6161
},
6262
"hotReloadProfile": "aspnetcore"
63-
},
63+
}
6464
{{/isNewProjectTypeEnabled}}
6565
}
6666
}

templates/vs/csharp/custom-copilot-basic/Utils/TextUtils.cs.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace {{SafeProjectName}}.Utils
88
public static string StripMentionsText(MessageActivity activity)
99
{
1010
if (string.IsNullOrEmpty(activity?.Text))
11-
return activity?.Text;
11+
return string.Empty;
1212
1313
var text = activity.Text;
1414

templates/vs/csharp/custom-copilot-rag-azure-ai-search/.{{NewProjectTypeName}}/launchSettings.json.tpl

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,28 @@
88
"M365_AGENTS_PLAYGROUND_TARGET_SDK": "teams-ai-v2-dotnet"
99
},
1010
"launchTestTool": true,
11-
"launchUrl": "http://localhost:56150",
11+
"launchUrl": "http://localhost:56150"
1212
},
1313
// Launch project within Teams
1414
"Microsoft Teams (browser)": {
1515
"commandName": "Project",
16-
"launchUrl": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&appTenantId=${{TEAMS_APP_TENANT_ID}}&login_hint=${{TEAMSFX_M365_USER_NAME}}",
16+
"launchUrl": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&appTenantId=${{TEAMS_APP_TENANT_ID}}&login_hint=${{TEAMSFX_M365_USER_NAME}}"
1717
},
18+
{{^CEAEnabled}}
19+
// Launch project within Teams without prepare app dependencies
20+
"Microsoft Teams (browser) (skip update app)": {
21+
"commandName": "Project",
22+
"environmentVariables": { "UPDATE_TEAMS_APP": "false" },
23+
"launchUrl": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&appTenantId=${{TEAMS_APP_TENANT_ID}}&login_hint=${{TEAMSFX_M365_USER_NAME}}"
24+
}
25+
{{/CEAEnabled}}
26+
{{#CEAEnabled}}
1827
// Launch project within Teams without prepare app dependencies
1928
"Microsoft Teams (browser) (skip update app)": {
2029
"commandName": "Project",
2130
"environmentVariables": { "UPDATE_TEAMS_APP": "false" },
2231
"launchUrl": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&appTenantId=${{TEAMS_APP_TENANT_ID}}&login_hint=${{TEAMSFX_M365_USER_NAME}}"
2332
},
24-
{{#CEAEnabled}}
2533
// Launch project within M365 Copilot
2634
"Microsoft 365 Copilot (browser)": {
2735
"commandName": "Project",
@@ -32,7 +40,7 @@
3240
"commandName": "Project",
3341
"environmentVariables": { "UPDATE_TEAMS_APP": "false" },
3442
"launchUrl": "https://m365.cloud.microsoft/chat/entity1-d870f6cd-4aa5-4d42-9626-ab690c041429/${{AGENT_HINT}}?auth=2"
35-
},
43+
}
3644
{{/CEAEnabled}}
3745
}
3846
}

templates/vs/csharp/custom-copilot-rag-azure-ai-search/AzureAISearchDataSource.cs.tpl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,49 +84,49 @@ namespace {{SafeProjectName}}
8484
/// <summary>
8585
/// Name of the Azure AI Search index
8686
/// </summary>
87-
public string IndexName { get; set; }
87+
public string? IndexName { get; set; }
8888

8989
/// <summary>
9090
/// Azure AI Search API key
9191
/// </summary>
92-
public string AzureAISearchApiKey { get; set; }
92+
public string AzureAISearchApiKey { get; set; } = string.Empty;
9393

9494
/// <summary>
9595
/// Azure AI Search endpoint
9696
/// </summary>
97-
public Uri AzureAISearchEndpoint { get; set; }
97+
public Uri? AzureAISearchEndpoint { get; set; }
9898

9999
{{#useOpenAI}}
100100
/// <summary>
101101
/// OpenAI API key
102102
/// </summary>
103-
public string OpenAIApiKey { get; set; }
103+
public string OpenAIApiKey { get; set; } = string.Empty;
104104

105105
/// <summary>
106106
/// OpenAI embeddings deployment name
107107
/// </summary>
108-
public string OpenAIEmbeddingModel { get; set; }
108+
public string OpenAIEmbeddingModel { get; set; } = string.Empty;
109109
{{/useOpenAI}}
110110
{{#useAzureOpenAI}}
111111
/// <summary>
112112
/// Azure OpenAI API key
113113
/// </summary>
114-
public string AzureOpenAIApiKey { get; set; }
114+
public string AzureOpenAIApiKey { get; set; } = string.Empty;
115115

116116
/// <summary>
117117
/// Azure OpenAI endpoint
118118
/// </summary>
119-
public string AzureOpenAIEndpoint { get; set; }
119+
public string AzureOpenAIEndpoint { get; set; } = string.Empty;
120120

121121
/// <summary>
122122
/// Azure OpenAI deployment name
123123
/// </summary>
124-
public string AzureOpenAIDeploymentName { get; set; }
124+
public string AzureOpenAIDeploymentName { get; set; } = string.Empty;
125125

126126
/// <summary>
127127
/// Azure OpenAI embeddings deployment name
128128
/// </summary>
129-
public string AzureOpenAIEmbeddingDeployment { get; set; }
129+
public string AzureOpenAIEmbeddingDeployment { get; set; } = string.Empty;
130130
{{/useAzureOpenAI}}
131131
}
132132
}

templates/vs/csharp/custom-copilot-rag-azure-ai-search/Config.cs.tpl

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ namespace {{SafeProjectName}}
22
{
33
public class ConfigOptions
44
{
5-
public TeamsConfigOptions Teams { get; set; }
5+
public TeamsConfigOptions Teams { get; set; } = new();
66
{{#useOpenAI}}
7-
public OpenAIConfigOptions OpenAI { get; set; }
8-
public AzureConfigOptions Azure { get; set; }
7+
public OpenAIConfigOptions OpenAI { get; set; } = new();
8+
public AzureConfigOptions Azure { get; set; } = new();
99
{{/useOpenAI}}
1010
{{#useAzureOpenAI}}
11-
public AzureConfigOptions Azure { get; set; }
11+
public AzureConfigOptions Azure { get; set; } = new();
1212
{{/useAzureOpenAI}}
1313
}
1414

1515
public class TeamsConfigOptions
1616
{
17-
public string BotType { get; set; }
18-
public string ClientId { get; set; }
19-
public string ClientSecret { get; set; }
20-
public string TenantId { get; set; }
17+
public string? BotType { get; set; }
18+
public string? ClientId { get; set; }
19+
public string? ClientSecret { get; set; }
20+
public string? TenantId { get; set; }
2121
}
2222

2323
{{#useOpenAI}}
@@ -26,14 +26,14 @@ namespace {{SafeProjectName}}
2626
/// </summary>
2727
public class OpenAIConfigOptions
2828
{
29-
public string ApiKey { get; set; }
30-
public string EmbeddingModel { get; set; }
29+
public string ApiKey { get; set; } = string.Empty;
30+
public string EmbeddingModel { get; set; } = string.Empty;
3131
public string DefaultModel = "gpt-3.5-turbo";
3232
}
3333
public class AzureConfigOptions
3434
{
35-
public string AISearchApiKey { get; set; }
36-
public string AISearchEndpoint { get; set; }
35+
public string AISearchApiKey { get; set; } = string.Empty;
36+
public string AISearchEndpoint { get; set; } = string.Empty;
3737
}
3838
{{/useOpenAI}}
3939
{{#useAzureOpenAI}}
@@ -42,12 +42,12 @@ namespace {{SafeProjectName}}
4242
/// </summary>
4343
public class AzureConfigOptions
4444
{
45-
public string OpenAIApiKey { get; set; }
46-
public string OpenAIEndpoint { get; set; }
47-
public string OpenAIDeploymentName { get; set; }
48-
public string OpenAIEmbeddingDeploymentName { get; set; }
49-
public string AISearchApiKey { get; set; }
50-
public string AISearchEndpoint { get; set; }
45+
public string OpenAIApiKey { get; set; } = string.Empty;
46+
public string OpenAIEndpoint { get; set; } = string.Empty;
47+
public string OpenAIDeploymentName { get; set; } = string.Empty;
48+
public string OpenAIEmbeddingDeploymentName { get; set; } = string.Empty;
49+
public string AISearchApiKey { get; set; } = string.Empty;
50+
public string AISearchEndpoint { get; set; } = string.Empty;
5151
}
5252
{{/useAzureOpenAI}}
5353
}

templates/vs/csharp/custom-copilot-rag-azure-ai-search/Document.cs.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ namespace {{SafeProjectName}}
77
public class Document
88
{
99
[SimpleField(IsKey = true, IsFilterable = true, IsSortable = true)]
10-
public string DocId { get; set; }
10+
public string? DocId { get; set; }
1111

1212
[SearchableField(IsFilterable = true, IsSortable = true)]
13-
public string DocTitle { get; set; }
13+
public string? DocTitle { get; set; }
1414

1515
[SearchableField(AnalyzerName = LexicalAnalyzerName.Values.EnLucene)]
16-
public string Description { get; set; }
16+
public string? Description { get; set; }
1717

1818
[VectorSearchField(VectorSearchDimensions = 1536, VectorSearchProfileName = "my-vector-config")]
1919
public IReadOnlyList<float>? DescriptionVector { get; set; } = null;

templates/vs/csharp/custom-copilot-rag-azure-ai-search/Properties/launchSettings.json.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"ASPNETCORE_ENVIRONMENT": "Development"
6161
},
6262
"hotReloadProfile": "aspnetcore"
63-
},
63+
}
6464
{{/isNewProjectTypeEnabled}}
6565
}
6666
}

0 commit comments

Comments
 (0)