StrataFrame Forum

Using BeforeSave Event in Web Application

http://forum.strataframe.net/Topic15914.aspx

By Cyrus Welch - 4/26/2008

I'm trying to use the before save event in a web application to log changes to the database.  I need to be able to access this from the application base page so I have access to the session and other application settings as well as my application's transaction log table.  It's working, however I get an error when building (which doesn't stop it from working, it's just very annoying at this point)

"Error 104 Method 'Private Sub snpccore_BeforeDelete(e As MicroFour.StrataFrame.Business.BeforeDeleteEventArgs)' cannot handle Event 'Public Event BeforeDelete(e As MicroFour.StrataFrame.Business.BeforeDeleteEventArgs)' because they do not have the same signature. C:\projects\MetSYSDotNet\MetSYSDotNet\App_Code\MetSYSSnapShotBasePage.vb 165 121 C:\...\MetSYSDotNet\"

I get the same error showing in the editor for each line as well.  I'm not sure why it thinks that the signature is not the same since it clearly is since it's clearly working (the event is getting called and it's properly calling the method I've set up with the object reference and such so I can parse and log all the data changes and they are indeed being logged properly). 

As I said, the build succeeds, unless there is ANOTHER error, in which case it's really painful to find the real error in all the other stuff.  I'm also getting the same issue with the BeforeDelete event which I'm using the log deletes as well, but I figure it's going to be the same issue.

BTW this is with version 1.6 and upgrading to the latest version isn't a option for a few days as the boss wants to get this version out the door in about 4 days.  Obviously this isn't going to be a stopper since it's working, but if there's an easy fix it's going to make any other troubleshooting easier for me.  I'll be ok with finding out that the latest version woudl make this go away since I'll be moving to it soon, but needed to ask anyways.

By Edhy Rijo - 4/26/2008

Cyrus Welch (04/26/2008)
BTW this is with version 1.6 and upgrading to the latest version isn't a option for a few days as the boss wants to get this version out the door in about 4 days.

Hi Cyrus,

Based on the error it is clear that you have an assembly version problem.  I don't do web development yet, but the current beta version 1.6.5.1 is pretty stable and you may want to try that, and if that does not work, you could go back to the previous version and that may clear the issue since in some of your folder there should be a different assembly with the different signature.

So make a backup of your project and upgrade to the latest version which will require you to do a clean install of SF anyway.Smile

By Cyrus Welch - 4/26/2008

Edhy Rijo (04/26/2008)
Cyrus Welch (04/26/2008)
BTW this is with version 1.6 and upgrading to the latest version isn't a option for a few days as the boss wants to get this version out the door in about 4 days.

Hi Cyrus,

Based on the error it is clear that you have an assembly version problem.  I don't do web development yet, but the current beta version 1.6.5.1 is pretty stable and you may want to try that, and if that does not work, you could go back to the previous version and that may clear the issue since in some of your folder there should be a different assembly with the different signature.

So make a backup of your project and upgrade to the latest version which will require you to do a clean install of SF anyway.Smile

I don't see how there could be an assembly version problem since it's setup in the recommended fashion where the business object assembly builds when the web project is built.  As I mentioned, as this point in the release cycle, and based on the fact that it actually compiles and runs just fine despite the ghost errors, upgrading is not an option until I get this out.  Then the FIRST step is to upgrade to 1.6.5 right away as I start to work on the .1 release of the product.  At this point it just means that I have to comment out ALL my logging code if I create an actual error so I can find it, unless of course the error is in the logging code, but I'm finished with it now and it's working so I'm not going to be touching it again until at least the .1 release. 

By Trent L. Taylor - 4/27/2008

Actually Edhy is right on the money.  This is the most annoying error that VS produces.  if you notice, they have the exact same signature in the error.  What this means is that there is a business assembly of (probably the StrataFrame Business assembly) in more than one location and they are not exactly the same...yet they are the same version.  This can happen when the assemblies are copied into the Bin folder, etc.  If you check all of your project folders as well as the GAC and the Common Files\MicroFour\StrataFrame folder.  I have seen this error many times in my life, and this is always the case.  It can be frustrating to track down at times also.  Sometimes when i can't find it, I will delete my local development folder altogether and get everything from source control again...as this cleans up all of the local folders.