Skip to content

Use Fody ConfigureAwait library instead of manual ConfigureAwait calls. - #2645

Merged
hikalkan merged 10 commits into
devfrom
maliming/FodyConfigureAwait
Feb 6, 2020
Merged

Use Fody ConfigureAwait library instead of manual ConfigureAwait calls.#2645
hikalkan merged 10 commits into
devfrom
maliming/FodyConfigureAwait

Conversation

@maliming

Copy link
Copy Markdown
Member
<Import Project="configureawait.props" />

<Project>
  <ItemGroup>
      <PackageReference Include="ConfigureAwait.Fody" Version="3.3.1" />
      <PackageReference Include="Fody" Version="6.0.6">
        <PrivateAssets>all</PrivateAssets>
        <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
      </PackageReference>
  </ItemGroup>
</Project>
FodyWeavers.xml 

<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
  <ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers> 
FodyWeavers.xsd 

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
  <xs:element name="Weavers">
    <xs:complexType>
      <xs:all>
        <xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
          </xs:complexType>
        </xs:element>
      </xs:all>
      <xs:attribute name="VerifyAssembly" type="xs:boolean">
        <xs:annotation>
          <xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="VerifyIgnoreCodes" type="xs:string">
        <xs:annotation>
          <xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="GenerateXsd" type="xs:boolean">
        <xs:annotation>
          <xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
        </xs:annotation>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
</xs:schema> 

image

@maliming

Copy link
Copy Markdown
Member Author

I will do more tests.

@maliming
maliming requested a review from hikalkan January 17, 2020 07:06
@hikalkan hikalkan added this to the 2.1 milestone Jan 17, 2020
@hikalkan

Copy link
Copy Markdown
Member

Related to #2577

@hikalkan

Copy link
Copy Markdown
Member

@maliming if that's OK, I will merge.

@maliming

Copy link
Copy Markdown
Member Author

I need to remove ConfigureAwait(false) in the test project.

@maliming

Copy link
Copy Markdown
Member Author

If there are no other issues to investigate, you can merge it.

@hikalkan

hikalkan commented Feb 5, 2020

Copy link
Copy Markdown
Member

@maliming I forked your PR branch, compiled the code, opened the Volo.Abp.Authorization.dll (as an example) in the JetBrains DotPeek and didn't see the ConfigureAwait calls.

Screenshot:

image

What I am missing?

@maliming

maliming commented Feb 6, 2020

Copy link
Copy Markdown
Member Author

hi @hikalkan
I use ILSpy and dnSpy.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants