Created
July 20, 2021 23:21
-
-
Save Dunge/190433d57a370adfb35085920451e11f to your computer and use it in GitHub Desktop.
ConfigureAwait.Fody Error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net5.0</TargetFramework> | |
<LangVersion>latest</LangVersion> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="ConfigureAwait.Fody" Version="3.3.1" PrivateAssets="All" /> | |
<PackageReference Include="Fody" Version="6.5.2"> | |
<PrivateAssets>all</PrivateAssets> | |
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | |
</PackageReference> | |
</ItemGroup> | |
</Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> | |
<ConfigureAwait ContinueOnCapturedContext="false" /> | |
</Weavers> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Threading.Tasks; | |
namespace FodyError | |
{ | |
class Program | |
{ | |
static async Task Main(string[] args) | |
{ | |
var serviceBuider = new ServiceBuilder(); | |
await serviceBuider.Start(); | |
} | |
} | |
public class ServiceBuilder | |
{ | |
private SomeObject _someObject = new SomeObject(); | |
public async Task Start() | |
{ | |
if (_someObject != null) | |
await _someObject?.SomeAsyncFunc(); | |
} | |
} | |
public class SomeObject | |
{ | |
public Task SomeAsyncFunc() | |
{ | |
return Task.CompletedTask; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment