VB to .NET

WARNING #1044

Sub Main in a DLL won't get called.

Description

This EWI is generated when a non EXE project type has a Sub Main as startup object. 

Recommendations

Since .Net DLLs doesn't have any method to execute it when the respective assembly is loaded, we have to add a static constructor and call the sub main inside.

This won't be executed at same time as VB6 but is the most similar behavior.

Sample VB6

Sub Main()
End Sub


Target VB.NET

Public Class Class1
	'UPGRADE_WARNING: (1044) Sub Main in a DLL won't get called.
	Public Sub Main()
	End Sub
End Class


Target C#

public class Class1
{
	//UPGRADE_WARNING: (1044) Sub Main in a DLL won't get called.
	public void Main()
	{
	}
}
Talk To An Engineer