Skip to content

Commit

Permalink
Merge pull request #6216 from dotnet/main
Browse files Browse the repository at this point in the history
  • Loading branch information
BillWagner authored Oct 5, 2023
2 parents 62e928a + 687a228 commit 3a7dee1
Show file tree
Hide file tree
Showing 13 changed files with 80 additions and 53 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!-- The package metadata. Fill in the properties marked as TODO below -->
<!-- Follow the instructions on https://learn.microsoft.com/en-us/nuget/create-packages/package-authoring-best-practices -->
<PackageId>AdatumCorporation.Utility.Templates</PackageId>
<PackageVersion>1.0</PackageVersion>
<Title>AdatumCorporation Templates</Title>
<Authors>Me</Authors>
<Description>Templates to use when creating an application for Adatum Corporation.</Description>
<PackageTags>dotnet-new;templates;contoso</PackageTags>
<PackageProjectUrl>https://www.microsoft.com</PackageProjectUrl>

<!-- Keep package type as 'Template' to show the package as a template package on nuget.org and make your template available in dotnet new search.-->
<PackageType>Template</PackageType>
<TargetFramework>net8.0</TargetFramework>
<IncludeContentInPack>true</IncludeContentInPack>
<IncludeBuildOutput>false</IncludeBuildOutput>
<ContentTargetFolders>content</ContentTargetFolders>
<NoWarn>$(NoWarn);NU5128</NoWarn>
<NoDefaultExcludes>true</NoDefaultExcludes>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<PropertyGroup>
<LocalizeTemplates>false</LocalizeTemplates>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.TemplateEngine.Tasks" Version="*" PrivateAssets="all" IsImplicitlyDefined="true"/>
</ItemGroup>

<ItemGroup>
<Content Include="content\**\*" Exclude="content\**\bin\**;content\**\obj\**" />
<Compile Remove="**\*" />
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="" />
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions core/tutorials/cli-templates-create-item-template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!-- Provide an overview of what your template package does and how to get started.
Consider previewing the README before uploading (https://learn.microsoft.com/en-us/nuget/nuget-org/package-readme-on-nuget-org#preview-your-readme). -->
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
"identity": "ExampleTemplate.AsyncProject",
"name": "Example templates: async project",
"shortName": "consoleasync",
"sourceName": "consoleasync",
"tags": {
"language": "C#",
"type": "project"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,15 @@
"tags": {
"language": "C#",
"type": "item"
},
"symbols": {
"ClassName":{
"type": "parameter",
"description": "The name of the code file and class.",
"datatype": "text",
"replaces": "StringExtensions",
"fileRename": "StringExtensions",
"defaultValue": "StringExtensions"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace System;

public static class StringExtensions
{
public static string Reverse(this string value)
{
char[] tempArray = value.ToCharArray();
Array.Reverse(tempArray);
return new string(tempArray);
}
}

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion core/workers/windows-service/WindowsBackgroundService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
await Task.Delay(TimeSpan.FromMinutes(1), stoppingToken);
}
}
catch (TaskCanceledException)
catch (OperationCanceledException)
{
// When the stopping token is canceled, for example, a call made from services.msc,
// we shouldn't exit with a non-zero exit code. In other words, this is expected...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static Task<TNewResult> ContinueWith<TResult, TNewResult>(

#region ToAsync(AsyncCallback, object)
/// <summary>
/// Creates a Task that represents the completion of another Task, and
/// Creates a Task that represents the completion of another Task, and
/// that schedules an AsyncCallback to run upon completion.
/// </summary>
/// <param name="task">The antecedent Task.</param>
Expand All @@ -73,7 +73,7 @@ public static Task ToAsync(this Task task, AsyncCallback callback, object state)
}

/// <summary>
/// Creates a Task that represents the completion of another Task, and
/// Creates a Task that represents the completion of another Task, and
/// that schedules an AsyncCallback to run upon completion.
/// </summary>
/// <param name="task">The antecedent Task.</param>
Expand Down Expand Up @@ -140,7 +140,7 @@ public static void PropagateExceptions(this Task task)
}

/// <summary>Propagates any exceptions that occurred on the specified tasks.</summary>
/// <param name="task">The Tassk whose exceptions are to be propagated.</param>
/// <param name="task">The Task whose exceptions are to be propagated.</param>
public static void PropagateExceptions(this Task[] tasks)
{
if (tasks == null) throw new ArgumentNullException(nameof(tasks));
Expand Down Expand Up @@ -169,13 +169,13 @@ private class TaskObservable<TResult> : IObservable<TResult>

public IDisposable Subscribe(IObserver<TResult> observer)
{
// Validate arguments
// Validate arguments.
if (observer == null) throw new ArgumentNullException("observer");

// Support cancelling the continuation if the observer is unsubscribed
// Support cancelling the continuation if the observer is unsubscribed.
var cts = new CancellationTokenSource();

// Create a continuation to pass data along to the observer
// Create a continuation to pass data along to the observer.
_task.ContinueWith(t =>
{
switch (t.Status)
Expand All @@ -190,7 +190,7 @@ public IDisposable Subscribe(IObserver<TResult> observer)
break;
case TaskStatus.Canceled:
observer.OnError(new TaskCanceledException(t));
observer.OnError(new OperationCanceledException("The operation was canceled."));
break;
}
}, cts.Token);
Expand All @@ -200,7 +200,7 @@ public IDisposable Subscribe(IObserver<TResult> observer)
}
}

/// <summary>Translate a call to IDisposable.Dispose to a CancellationTokenSource.Cancel.</summary>
/// <summary>Translates a call to IDisposable.Dispose to a CancellationTokenSource.Cancel.</summary>
private class CancelOnDispose : IDisposable
{
internal CancellationTokenSource _source;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Octokit" Version="8.0.0" />
<PackageReference Include="Octokit" Version="8.0.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Octokit" Version="8.0.0" />
<PackageReference Include="Octokit" Version="8.0.1" />
</ItemGroup>

</Project>

0 comments on commit 3a7dee1

Please sign in to comment.