A
A
AlexCruel2021-06-21 16:31:11
C++ / C#
AlexCruel, 2021-06-21 16:31:11

How to fix the PersistenceException system error?

The code is the same in two projects. In the first it works, in the second it gives an error. Calling server:
var parcelShops = svc.getParcelShops(request);

Throws error:
System.ServiceModel.FaultException`1: "System Error: PersistenceException"

Next "To prevent an unsafe abort while evaluating the System.Windows.Controls.Control.ToString function, all threads were allowed to run. This could change the state process, and any breakpoints encountered were skipped.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Bereznikov, 2021-06-22
@gdt

I think it would be helpful to first look at the code inside getParcelShops, the error is clearly coming from there. In general, before asking a question, it is very useful to try to search for information in your favorite search engine:
persistenceexception c#
First link - PersistenceException Class
Written:

This exception is thrown by a SqlPersistenceProviderFactory when general connectivity errors are encountered.

Thus, your svc somewhere within itself somehow uses the SqlPersistenceProviderFactory, and apparently has some problems connecting to the server. Check your Connection String, then if everything is correct, there are two main options:
  • The server is located somewhere on the Internet, then you have a problem with the firewall (either on your side or on the server side)
  • The server must be deployed locally - check that it is deployed and running, the port is available for connection, the firewall does not block local connections

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question