OpenRIAServices / OpenRiaServices

The Open RIA Services project continues what was previously known as WCF RIA Services.
https://openriaservices.gitbook.io/openriaservices/
Apache License 2.0
54 stars 47 forks source link

Please clarify instructions to debug code generation #504

Open JohanHeyvaert opened 1 month ago

JohanHeyvaert commented 1 month ago

Hello, We are using an older version of OpenRiaServices (4.6.3). The code generation has been working correctly on my computer for months, but recently it alwas fails with the dreaded error "Exception has been thrown by the target of an invocation". The error is normally not caused by changes in our code as 3 of my colleagues don't have this error. One other has though.

As we don't have any idea of the cause I'm afraid we don't have any other solution then try to debug the code generation?

I've tried to follow the instructions (https://github.com/OpenRIAServices/OpenRiaServices/wiki/Debugging-Open-Ria-Code-generation-source) but no breakpoints are hit. Probably we did not correctly perform step 2:

Copy your assemblies including pdb files (pdb files are required in order to point out where the source is located on your machine) 2b. If you use the text templating tools then also make sure to compile and reference your version of "OpenRiaServices.DomainServices.Tools.TextTemplate"

This instruction doesn't clearly state to which destination you have to copy these files? Could you please add this info?

Thanks in advance.

Best regards, Johan

SandstromErik commented 1 month ago

Hello, Firstly, since you are on an old version you should probably update to a newer version. Furtermore, better error messages have been worked on and with the next release they should be more helpful.

We will also have a look at the instructions, in order to clarify them.

Daniel-Svensson commented 1 month ago

Sometimes it is enough to replace the files in the bin folder of the web projects, but is more reliable to replace the files in the nuget folder. Or remove the nuget and add explicit references to locally compiled files.

But I would definitely recommend to try the latest versions, there is no intention to make fixes to 4.6.x versions.

JohanHeyvaert commented 1 month ago

Thanks, I'll give it another try. We have tried to update OpenRiaServices in the past, but we encountered incompatibility issues that we were unable to solve. I guess we should retry that too.

JohanHeyvaert commented 1 month ago

Good news: I was able to debug the code generation and I found the problem: a missing config file referenced by our app.config. To pinpoint the problem I wrote a simple logger proxy that wrapped the injected ILoggingService. I found the error via a breakpoint in the LogError method and then following the stack trace.