Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Remove PostSharp reference and, if present, the file RequiresPostSharp.cs from the project (selected items in figure above).
  2. Open packages.config and remove the reference to PostSharp. The exact syntax will depend on the version of the .NET framework you are working with, and the corresponding version of PostSharp available at the moment of following this tutorial. So the reference could be, for example:
    <package id="PostSharp" version="2.1.7.28" targetFramework="net40" />
    or
    <package id="PostSharp" version="3.1.75" targetFramework="net452" />
  3. Remove all other references to PostSharp in the project:
    1. Unload the project (right click on project - Unload project)
    2. Edit project file (right click on project - Edit DeltaShell.Plugins.VolumeModel.csproj)
    3. Remove (near all lines indicating that PostSharp should be imported in the project. These lines are frequently located close to the end of the csproj ) all references to PostSharpfile. For example:

      Code Block
      languagec#
      <Import Project="..\packages\PostSharp.2.1.7.28\tools\PostSharp.targets" Condition="Exists('..\packages\PostSharp.2.1.7.28\tools\PostSharp.targets')" />


      or

      Code Block
      languagec#
      <Import Project="..\packages\PostSharp.3.1.75\tools\PostSharp.targets" Condition="Exists('..\packages\PostSharp.3.1.75\tools\PostSharp.targets')" />
        <Target Name="EnsurePostSharpImported" BeforeTargets="BeforeBuild" Condition="'$(PostSharp30Imported)' == ''">
          <Error Condition="!Exists('..\packages\PostSharp.3.1.75\tools\PostSharp.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://www.postsharp.net/links/nuget-restore." />
          <Error Condition="Exists('..\packages\PostSharp.3.1.75\tools\PostSharp.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://www.postsharp.net/links/nuget-restore." />
        </Target>


      The exact lines to be removed will depend on the version of Visual Studio being used, and on the version of PostSharp that was incorporated to the project.

    4. Finally, load project back again.

...