ppittle / pMixins

pMixins - Mixin framework for C#
http://pMixins.com
Apache License 2.0
23 stars 5 forks source link

`DisableCodeGeneration` attribute should not clear existing Mixin code behind files #36

Open ppittle opened 9 years ago

ppittle commented 9 years ago

It was reported that DisableCodeGeneration attribute is removing Mixin code behind files on build. This should not occur.

naskovai commented 9 years ago

When I hit Ctrl + S in a file which contains a class I get an empty *.mixin.cs file even though the file I have saved doesn't contain any partial classes annotated with pMixinAttribute.

ppittle commented 9 years ago

And this is with the DisableCodeGeneration attribute defined at the assembly level (in AssemblyInfo.cs)?

ppittle commented 9 years ago

Hi Paletov,

I have tried to reproduce the behavior you are experiencing but haven't been able to.

Using Visual Studio 2013 Update 4 with pMixins 0.6.0.457 I performed the following steps:

1) Create a new Project 2) Add a dummy method AMethod to Class1 3) Add a pMixin file, via the pMixin Item Template 4) Add a pMixin definition:

      [pMixin(Mixin = typeof(Class1))]
      public partial class Mixin { }

5) Confirmed pMixin code behind was generated. 6) Add [assembly: CopaceticSoftware.pMixins.Attributes.DisableCodeGeneration] to AssemblyInfo.cs 7) Build Project 8) Confirmed (via pMixins Code Generator in Output Window ) no Code Generation occurred. 9) Confirmed previous pMixin code behind file was still present and correct.

Can you send me the steps you took to setup your project to get the behavior you are seeing (generating empty pMixin code behind files on non valid targets and valid pMixin code behind files being erased)?