-
Notifications
You must be signed in to change notification settings - Fork 26
Unable to remove backing field #340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hello @wizgob, Sure, I will be glad to tackle the issue for you. This error usually happens when there is no backing field to delete. So I would like to see the original IL code (or an assembly so I would be able to open it with ILDasm and compare with processed assembly content). I also would like to know what happens when project is built with only weaver - we need to either exclude Postsharp from suspects' list or prove it is guilty (if it is). Understanding what happens first - weaving or "postsharp"-ing, also important. We had problems with prebuilds by Visual Studio so we added condition for our target like We can switch to emails for private talk. Write a letter to [email protected] with title I'll be waiting. |
Hello @alex-kulakov, I confirm we have the error only with the developer tools, altough me use JetBrains Rider and not Visual Studio. I think it will difficult to remove Postsharp from our projet : we do not have a reduced project reproducing the issue, we only get it on some builds, and not with all computers. I'm sending the sample files by email so you can check the IL. |
Ok, Let's move to emails and continue talking there. |
BTW, you can try following:
and:
It may show some results to think about. First sequence of actions may show you weaving problem if there is some sort of partial build or pre-build done by IDE |
I haven't received any emails from you yet. Did you send something? |
…cking field does not exist
Our team is getting random errors during build:
EXEC: Error XW0006 : Unable to remove backing field: type: MyType, property: MyProperty, field:
We are using Xtensive.Orm 6.0.11 with .net 4.7.2.
We are also using Postsharp 2023.0.7
I've been able to attach te debugger to Xtensive.Orm.Weaver.dll: The issue seems to be that RemoveBackingFieldTask.GetBackingFieldName() is returning null.
The contents of property.GetMethod.Body.Instructions seems to indicate the assembly was already processed wy the weaver

Arguments file passed to the weaver:
And MyProject.dll from obj\Debug contains the ProcessedByWeaver attribute:

This error is a problem for us because the workaround is to clean, the build again the solution which takes 8 minutes because we have a big solution.
I'm not able to reproduce it every time : this error appears randomly.
I suspect something in the build process when doing a partial build of the solution is causing the weaver to get as an input an assembly that is already weaved.
Do you think adding a condition in the weaver do to nothing if the file is already weaved could be a solution?
I have saved the content of an obj folder just before the error and the command to launch the weaver : I can share them privately if needed.
The text was updated successfully, but these errors were encountered: