The simple answer is, probably, yes, sort of. But, there are two questions here to be resolved.
Question #1 - meaning of ὁρκίζω ( horkizó)
The operative word in 1 Thess 5:27 is ὁρκίζω ( horkizó), which, according to BDAG has this meaning:
to give a command to someone under oath, abjure, implore, eg, Matt 26:63, Mark 5:7, Acts 19:13, 1 Thess 5:27
These cases in the NT all involved placing someone under a solemn oath/promise to do something. Ellicott notes this about 1 Thess 5:27 -
(27) I charge you.—Adjure is much nearer the original word, which is
as solemn as can be.
Question #2 - Contradiction between 1 Thess 5:17 and James 5:12
The "problem" in Matt 5:33-37 and James 5:12 about the apparent contradiction over oaths has been asked before here >> Swear or not swear?
Ellicott provides a good explanation of Matt 5:33-37 as reproduced in the appendix below.
APPENDIX - Ellicott on Matt 5:33-37.
(34) Swear not at all.—Not a few interpreters, and even whole
Christian communities, as e.g. the Society of Friends, see in these
words, and in James 5:12, a formal prohibition of all oaths, either
promissory or evidential, and look on the general practice of
Christians, and the formal teaching of the Church of England in her
Articles (Art. xxxix.), as simply an acquiescence in evil. The first
impression made by the words is indeed so strongly in their favour
that the scruples of such men ought to be dealt with (as English
legislation has at last dealt with them) with great tenderness. Their
conclusion is, however, it is believed, mistaken:
Because, were it true, then in this instance our Lord would be directly repealing part of the moral law given by Moses, instead of
completing and expanding it, as in the case of the Sixth and Seventh
Commandments. He would be destroying, not fulfilling.
Because our Lord himself answered, when He had before been silent, to a solemn formal adjuration (Matthew 26:63-64), and St. Paul
repeatedly uses such forms of attestation (Romans 1:9; 1 Corinthians
15:31; 2 Corinthians 1:23; Galatians 1:20; Philippians 1:8).
Because the context shows that the sin which our Lord condemned was the light use of oaths in common speech, and with no real thought
as to their meaning. Such oaths practically involved irreverence, and
were therefore inconsistent with the fear of God.
The real purpose of an oath is to intensify that fear by bringing the
thought of God’s presence home to men at the very time they take them,
and they are therefore rightly used when they attain that end.
Practically, it must be admitted that the needless multiplication of
oaths, both evidential and promissory, on trivial occasions, has
tended, and still tends, to weaken awe and impair men’s reverence for
truth, and we may rejoice when their number is diminished. In an ideal
Christian society no oaths would be needed, for every word would be
spoken as by those who knew that the Eternal Judge was hearing them.