Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Overload resolution failed because no accessible 'New' can be called

Hello, I'm working on a program that uses codedom and in my source code I have this

PHP Code

<?php 
Dim t 
As New Thread(AddressOf DoExecute)
t.TrySetApartmentState(ApartmentState.STA)
t.Start(bytes) 

The Error "Overload resolution failed because no accessible 'New' can be called" Is thrown whenever I try to compile the codedom at what I would assume to be "Dim t As New Thread(AddressOf DoExecute)"

I've googled around and all the threads that I've read on it haven't helped, so please refrain from posting links.

Here is the entire code that I'm trying to compile with codedom.
Spoiler (Click to View)
If you are trying to use multi threading then..
Code
Dim thread As System.Threading.Thread
thread = New System.Threading.Thread(AddressOf DoExecute)
thread.Start()

If you get an error type in, Me.CheckForIllegalCrossThreadCalls = False
Should work If you do not use parenthesis.
(Jun 13, 2014 08:53 PM)+Haze Wrote:  If you are trying to use multi threading then..
Code
Dim thread As System.Threading.Thread
thread = New System.Threading.Thread(AddressOf DoExecute)
thread.Start()

If you get an error type in, Me.CheckForIllegalCrossThreadCalls = False
Should work If you do not use parenthesis.

This still throws the same error
Code
Dim thread As System.Threading.Thread
thread = New System.Threading.Thread(AddressOf DoExecute)
thread.Start()

And where would you want me to use Me.CheckForIllegalCrossThreadCalls = False, would it be in the source that I'm compiling or in the compiler itself? Sorry just a bit unclear with what you said.
(Jun 13, 2014 08:54 PM)loopy90 Wrote:  This still throws the same error
Code
Dim thread As System.Threading.Thread
thread = New System.Threading.Thread(AddressOf DoExecute)
thread.Start()

And where would you want me to use Me.CheckForIllegalCrossThreadCalls = False, would it be in the source that I'm compiling or in the compiler itself? Sorry just a bit unclear with what you said.

The above user has no clue what he is talking about, refrain from using his advice.
[Image: jlscvfi.png]
(Jun 13, 2014 09:27 PM)NETExplorer Wrote:  The above user has no clue what he is talking about, refrain from using his advice.

Thanks, I thought I would also add that this code compiles/runs perfectly fine If I'm using VS but when I try to compile with codedom it throws the error.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by ZhuangziJun 29, 2017 08:51 AM 7 364 Jun 29, 2017 08:51 AM
Last Post: AmericanExpress
[.NET] by Lexxi.Mar 5, 2017 12:03 AM 11 172 Mar 5, 2017 12:03 AM
Last Post: uint32
[.NET] by PharmacistOct 28, 2016 07:01 AM 4 235 Oct 28, 2016 07:01 AM
Last Post: Pharmacist