0
public void Start()
{
    try
    {
        // Create thread-safe- load and build the domain!
        _log.Info("Attempting to validate and build/load domain");
        var connStr = ConfigurationManager.ConnectionStrings["MyConnection"].ConnectionString;
        var dataStore = XpoDefault.GetConnectionProvider(connStr, AutoCreateOption.None);

        using (var dataLayer = new SimpleDataLayer(dataStore))
        {
            using (var session = new Session(dataLayer))
            {
                XpoDefault.DataLayer = new ThreadSafeDataLayer(session.Dictionary, dataStore);
            }
        }

        XpoDefault.Session = null;

        _log.Info("Successfully loaded and validated domain");
    }
}

This is the code I have written in C# to connect to Postgresql.

The line at which the code is breaking is

var dataStore = XpoDefault.GetConnectionProvider(connStr, AutoCreateOption.None);

I am getting this error:

System.Net.Sockets.SocketException

A non-blocking socket operation could not be completed immediately XXXXXXXXXX:5432

Previously the same project is running fine but suddenly I am seeing this error. I have DevExpress 17.2 in my system. Can anyone please help me. Thanks in advance.

1 Answer 1

4

The answer is silly...but it solved my issue. :(

Tools --> Options --> Debugging --> General --> Enable Just My Code

I checked this flag in Visual Studio 2017 and the issue was resolved.

Sign up to request clarification or add additional context in comments.

1 Comment

in my case Enable Just My Code was already checked. Unchecking it resolved the issue. Don't ask an for explanation cause I don't have one :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.