Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8836551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:31:21+00:00 2026-06-14T09:31:21+00:00

Hello I am getting an error on the following line: If Not System.Windows.Clipboard.GetDataObject Is

  • 0

Hello I am getting an error on the following line:

If Not System.Windows.Clipboard.GetDataObject Is Nothing Then

I believe it would look something like this in C#

if (System.Windows.Clipboard.GetDataObject!=null) {

The Error is:

“ThreadStateException: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made.”

Can anyone tell me how to fix this? A few suggestions online mentioned adding <STAThread()> _ over the ‘main’ method, however, this is an ASP.NET controller method, I tried adding this over it and it didn’t help. Anyone have any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:31:22+00:00Added an answer on June 14, 2026 at 9:31 am

    ASP.NET doesn’t really get along with STAThread.

    You need an additional task scheduler to run a thread in STA mode to access what you want from the operating system

    Take a look at this article it got me going with something like this.

    Also, keep in mind that multiple request to your page might mess up things, since you’re interacting with the clipboard of the operating system (which runs in another COM context) son concurrency might by risky.

    What are you trying to acomplish, maybe there is a better way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I'm getting the following error Notice: Undefined offset: 1 in file.php on line
Hello not sure why Im getting this error. Basically I get it in these
Hello all im getting the following error. I tried putting the files everywhere i
Hello friends I am getting the following error while making the foreign key 'tbl_course'
Hello I am currently getting an index out of range error from the following
I'm getting following error when invoking my testtag.jsp : org.apache.jasper.JasperException: Unable to convert string
I' getting the following error while trying to run my application from oauth2client.appengine import
I'm getting the following error when I try to run a jsp page with
When I run my Kynetx app I am getting the following error: Can't use
I'm getting an error while running the following code: class Person: def _init_(self, name):

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.