CNeptune icon indicating copy to clipboard operation
CNeptune copied to clipboard

Error in first build.

Open feldrim opened this issue 7 years ago • 9 comments

I wanted to try NConcern and create a simple console application that lists folder content. But this error occured. The command ""C:\Users\f\Documents\Visual Studio 2015\Projects\FolderList\packages\CNeptune.1.1.0\build\CNeptune.exe" "C:\Users\f\Documents\Visual Studio 2015\Projects\FolderList\FolderList\FolderList.csproj" "Debug"" exited with code -532462766

feldrim avatar Jun 03 '17 19:06 feldrim

Can I ask you some information about your console application? target framework, architecture (x86, x64), unsafe code, com interop usage?

Puresharper avatar Jun 03 '17 21:06 Puresharper

  • VS 2015 Community
  • .NET Framework 4.6.2
  • x64 It's just a console app to learn NConcern that reads a string, path of a folder and copies them to the back up folder. I created methods with custom annotation, "Operation". It worked as usual, but not after I added NConcern. There's no single warning except for the error above.

feldrim avatar Jun 03 '17 22:06 feldrim

Can you share your code if it is not confidential? If I can test it, it will help me to understand what cause the issue. If you have a github repository, it will be good to clone your test project and debug it.

Puresharper avatar Jun 03 '17 22:06 Puresharper

I've uploaded on this repository. There are a few extra lines in app.config. They are remains of log4net and no ned to bother.

feldrim avatar Jun 04 '17 08:06 feldrim

Hi, good news, I just tested it and sorry was my fault because issue is a known issue.

Indeed, there is some missing instruction cloning in CNeptune that failed when an exception handling is used.

In your case simply used using() statement translate it in try/finally that make CNeptune failed. I already fix it but not release it. I will patch it in few hours after passing some test.

here the CNeptune code that failed : https://github.com/Virtuoze/CNeptune/blob/8b983efc3f5ff5665db6008a228b01d6003c0c7b/CNeptune/CNeptune/Program.cs#L130

here the equivalent fixed in Puresharp https://github.com/Virtuoze/Puresharp/blob/21673c0c03ce2f0a94c1f9ae6b49be679cc87ec7/Puresharp/Puresharper/Program.cs#L134

3 lines are missing in CNeptune to build correctly exception handling. I have to report changes, test it, pack it in a nuget new version.

Thank you for report, this bug is a big constraint... I was optimist on Puresharp release but personal life make me report release for later, that's why i was'nt report all fix.

Puresharper avatar Jun 04 '17 12:06 Puresharper

I'm glad it helped to find out something important. It's OK for me since I wrote that application to learn and test NConcern. I have used postsharp before but want to use something open source as an AOP solution. I'm looking forward to seeing the next release anytime soon.

feldrim avatar Jun 04 '17 14:06 feldrim

CNeptune has been patched : the bug is now fixed in version 1.2.0 https://www.nuget.org/packages/CNeptune

Unfortunately during test, I found a performance issue on startup because NConcern try to locate pointcut in all framework that take long time... I have to patch NConcern to ignore Framework Assemblies.

Puresharper avatar Jun 05 '17 12:06 Puresharper

Another fix was done on 1.2.1 NConcern was just updated to 4.1.0 to ignore framework assembly when lookup joinpoint

Puresharper avatar Jun 06 '17 20:06 Puresharper

I've tested and it worked very well. Thanks. Though I had a "stack overflow exception" problem with a LINQ query. I converted it to a simple foreach + if + some other code statement and it solved the issue. If I manage to recreate the problem, I'll open another issue about that.

feldrim avatar Jun 11 '17 10:06 feldrim