Code Monkey home page Code Monkey logo

scalpel's Introduction

AppVeyor Chat on Gitter NuGet Status Patrons on Open Collective

Extensible tool for weaving .net assemblies

Manipulating the IL of an assembly as part of a build requires a significant amount of plumbing code. This plumbing code involves knowledge of both the MSBuild and Visual Studio APIs. Fody attempts to eliminate that plumbing code through an extensible add-in model.

This is the codebase of core Fody engine. For more information on the larger Fody project see https://github.com/Fody/Home.

See Milestones for release notes.

Already a Patron? skip past this section

Community backed

Fody requires significant effort to maintain. As such it relies on financial support to ensure its long term viability.

It is expected that all developers using Fody become a Patron on OpenCollective.

See Licensing/Patron FAQ for more information.

Gold Sponsors

Support this project by becoming a Gold Sponsor. A large company logo will be added here with a link to your website.

PostSharp

Silver Sponsors

Support this project by becoming a Silver Sponsor. A medium company logo will be added here with a link to your website.

G-Research Particular Software

Bronze Sponsors

Support this project by becoming a Bronze Sponsor. The company avatar will show up here with a link to your OpenCollective Profile.

Patrons and sponsors

Thanks to all the backers and sponsors! Support this project by becoming a patron.

Documentation and Further Learning

Contributors

This project exists thanks to all the people who contribute.

scalpel's People

Contributors

dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar ltrzesniewski avatar simoncropp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scalpel's Issues

Exception:: Member *** is declared in another module and needs to be imported

Hi,
I try use Scalpel.Fody, but I get exception:
Error 1 Fody: An unhandled exception occurred: Exception: Member 'PcapngUtils.Pcap.SectionHeader' is declared in another module and needs to be imported StackTrace: at Mono.Cecil.MetadataBuilder.LookupToken(IMetadataTokenProvider provider) at Mono.Cecil.SignatureWriter.WriteTypeSignature(TypeReference type) at Mono.Cecil.MetadataBuilder.GetFieldSignature(FieldReference field) at Mono.Cecil.MetadataBuilder.AddField(FieldDefinition field) at Mono.Cecil.MetadataBuilder.AddFields(TypeDefinition type) at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type) at Mono.Cecil.MetadataBuilder.AddTypeDefs() at Mono.Cecil.MetadataBuilder.BuildTypes() at Mono.Cecil.MetadataBuilder.BuildModule() at Mono.Cecil.ModuleWriter.<BuildMetadata>b__0(MetadataBuilder builder, MetadataReader _) at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func 3 read) at Mono.Cecil.ModuleWriter.BuildMetadata(ModuleDefinition module, MetadataBuilder metadata) at Mono.Cecil.ModuleWriter.WriteModuleTo(ModuleDefinition module, Stream stream, WriterParameters parameters) at Mono.Cecil.ModuleDefinition.Write(Stream stream, WriterParameters parameters) at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters) at InnerWeaver.WriteModule() in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\FodyIsolated\ModuleWriter.cs:line 18 at InnerWeaver.Execute() in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\FodyIsolated\InnerWeaver.cs:line 65 Source: Mono.Cecil TargetSite: Mono.Cecil.MetadataToken LookupToken(Mono.Cecil.IMetadataTokenProvider) ScalpelProblem

My project contain nUnit framework. Exception occured, when first class has atribute [TestFixture], and second class contains object of first class (as field).

  1. First class
    [TestFixture]
    public sealed class SectionHeader
    {
    public UInt16 MajorVersion { get; set; }
    }
  2. Secons class
    public sealed class PcapWriter
    {
    public SectionHeader header = null;
    }

Here is an example project that can reproduce the issue:
https://dl.dropboxusercontent.com/u/75969946/ScalpelProblem.7z

I checked the source code but had no idea how to fix it :/.

add a samples

possibly link to fody samples for a downloadable project

show some before after code in the main readme.md

Update to Fody 3.0

Seeing as this Fody add-in is no longer maintained, I'd be willing to either take ownership or submit a PR.

PCL Target ?

Hello.

Foremost, all this hard work is very impressive. Thanks for sharing with the community.

I find the idea of moving my tests as "first-class citizens" very appealing and sensible.
I am using a PCL library which holds the core of my test-demanding code, are we able to use Scalpel with PCL target ?

This is the error I get when trying to reference current nuGet package from said PCL library:

Could not install package 'Scalpel.Fody 1.0.4'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

MSpec remover fails when MSpec context contains nested class with a reference to another nested class

public class Something
{
  It does_not_matter;

  class Parent
  {
    public Child Child { get; set; }
  }

  class Child
  {
  }
}

When running Fody we receive the following NullReferenceException:

MSBUILD : error : Fody: An unhandled exception occurred:\r [d:\somewhere\some.csproj]
MSBUILD : error : Exception:\r [d:\somewhere\some.csproj]
MSBUILD : error : Object reference not set to an instance of an object.\r [d:\somewhere\some.csproj]
MSBUILD : error : StackTrace:\r [d:\somewhere\some.csproj]
MSBUILD : error :    at MSpecRemover.IsMspecField(FieldDefinition fieldDefinition) at c:\TeamCity\buildAgent\work\65b82fbfffdc864f\Fody\Removers\MSpecRemover.cs:line 39.\r [d:\somewhere\some.csproj]
MSBUILD : error :    at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)\r [d:\somewhere\some.csproj]
MSBUILD : error :    at MSpecRemover.ContainsMSpecField(TypeDefinition typeDefinition) at c:\TeamCity\buildAgent\work\65b82fbfffdc864f\Fody\Removers\MSpecRemover.cs:line 34.\r [d:\somewhere\some.csproj]
MSBUILD : error :    at MSpecRemover.ShouldRemoveType(TypeDefinition typeDefinition) at c:\TeamCity\buildAgent\work\65b82fbfffdc864f\Fody\Removers\MSpecRemover.cs:line 26.\r [d:\somewhere\some.csproj]
MSBUILD : error :    at ModuleWeaver.<>c__DisplayClass19.<CleanTypesBasedOnRemovers>b__17(IRemover x) at c:\TeamCity\buildAgent\work\65b82fbfffdc864f\Fody\ModuleWeaver.cs:line 86.\r [d:\somewhere\some.csproj]
MSBUILD : error :    at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)\r [d:\somewhere\some.csproj]
MSBUILD : error :    at ModuleWeaver.CleanTypesBasedOnRemovers() at c:\TeamCity\buildAgent\work\65b82fbfffdc864f\Fody\ModuleWeaver.cs:line 84.\r [d:\somewhere\some.csproj]
MSBUILD : error :    at ModuleWeaver.Execute() at c:\TeamCity\buildAgent\work\65b82fbfffdc864f\Fody\ModuleWeaver.cs:line 55.\r [d:\somewhere\some.csproj]
MSBUILD : error :    at lambda_method(Closure , Object )\r [d:\somewhere\some.csproj]
MSBUILD : error :    at InnerWeaver.ExecuteWeavers(List`1 weaverInstances) at c:\TeamCity\buildAgent\work\7495521761d392b9\FodyIsolated\InnerWeaver.cs:line 90.\r [d:\somewhere\some.csproj]
MSBUILD : error :    at InnerWeaver.Execute() at c:\TeamCity\buildAgent\work\7495521761d392b9\FodyIsolated\InnerWeaver.cs:line 31.\r [d:\somewhere\some.csproj]
MSBUILD : error : Source:\r [d:\somewhere\some.csproj]
MSBUILD : error : Scalpel.Fody\r [d:\somewhere\some.csproj]
MSBUILD : error : TargetSite:\r [d:\somewhere\some.csproj]
MSBUILD : error : Boolean IsMspecField(Mono.Cecil.FieldDefinition)\r [d:\somewhere\some.csproj]
MSBUILD : error :  [d:\somewhere\some.csproj]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.