Error "A project with an output type of class library cannot be started directly"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pyar
    New Member
    • Jul 2008
    • 4

    Error "A project with an output type of class library cannot be started directly"

    Hi, i have loaded my VBScript to VB.Net(VS class library).Here is the sample.Problem is that when i am trying to complie im getting this error as to include exe in the project.I acn have exe only if the project is compiled atleast once.But iam unable to compile my project.Could anyone tell me whats the problem?Thankx for any ideas.
    Code:
    Public Class Form1
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
            Dim fso
            fso = CreateObject("Scripting.FileSystemObject")
            fso.CopyFile("c:\mydir\*.*", "d:\backup\", True)
    
        End Sub
    End Class
    Last edited by Curtis Rutland; Jul 15 '08, 02:02 PM. Reason: Added Code Tags - Please use the # button
  • cloud255
    Recognized Expert Contributor
    • Jun 2008
    • 427

    #2
    On the project which you want to run at start up you need to specify a setting other than class library. so right click on the project you want to run, select properties and change the output type.

    save the properties.

    now select the project again by right clicking it and select 'Set as StartUp Project'

    good luck

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      You built a library. A Library(DLL) cannot be "run".
      I suspect you are actually trying to run. not build the project.

      Select build from the menu and do not use F5

      Comment

      • pyar
        New Member
        • Jul 2008
        • 4

        #4
        thanks for the quick reply.My major issue is to know how to "Convert VBScript to DLL"..I dono whats the correct steps to do it.As specified earlier i have a small vbscript which i have loaded to VB.NET.I have got the .dll file in the project directory.Probl em is that my project is not running.Please guide me accordingly if my steps are wrong.Hoping for the best.

        Cheers

        Comment

        Working...