Skip to content
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

Please clarify instructions to debug code generation #504

Open
JohanHeyvaert opened this issue May 8, 2024 · 4 comments
Open

Please clarify instructions to debug code generation #504

JohanHeyvaert opened this issue May 8, 2024 · 4 comments

Comments

@JohanHeyvaert
Copy link

JohanHeyvaert commented May 8, 2024

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
Copy link
Contributor

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
Copy link
Member

Daniel-Svensson commented May 10, 2024

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
Copy link
Author

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
Copy link
Author

JohanHeyvaert commented May 13, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants