Unhandled exception in VS2017 when returning http_client when it worked in VS2013

0

I have an issue with http_client, it crashed on this line

return http_client{s2ws(strURL), config};

The error message is this one:

Unhandled exception at 0x04887DF4 (cpprest_2_10d.dll) in exe: 0xC0000005: Access violation writing location 0x00000033.

I am using VS2017, but with 2013 it worked.

http_client CreateHttpClient(const CString& strURL)
{
http_client_config config;
config.set_proxy(web_proxy{ web_proxy::use_auto_discovery });
return http_client{s2ws(strURL), config};
}

And if I don't use the http_client_config for the second parameter, just the URL then there is no crash, but I need the http_client_config. I searched on internet, it seems this problem was quite famous, but until now could not find any solution.

Do you have any idea of how to solve it?

visual-studio
c++17
asked on Stack Overflow Apr 5, 2019 by ntngocanh1980 • edited Apr 5, 2019 by M.K

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0