locked
Deugging SharePoint 2007 solution RRS feed

  • Question

  • Hi All,

    I've Sharepoint Solution file. I opened the solution file in visual studio 2008 and builded the solutiion with no errors. When debugging the code i  am getting the below error.

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

                In order to debug this project, add an executable project to this solution which references the   

               library project .Set the executable project as the startup project.

    Please help me to debug the code..

    Thanks

    Wednesday, July 25, 2012 9:29 AM

All replies

  • Hi Santhosh,

    Well, it turns out that all you need to enable debugging in Visual Basic Express Edition is a separate file in the project folder, called "MyProjectName.vbproj.user". This contains the user-specific project settings for the MyProjectName project. In my test I used the default project name for a Class Library, and so the file was called "ClassLibrary1.vbproj.user" and in the same folder as "ClassLibrary1.vbproj". Here is what th file needs to read:

    <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
        <StartAction>Program</StartAction>
        <StartProgram>C:\Program Files\Your Application\Application.exe</StartProgram>
      </PropertyGroup>
    </Project>

    After creating this file (please make sure the executable path is correct for your system, of course), you will need to reopen the project for it to be detected and read. But once it's found, you can debug your class library project with an external executable, just by hitting F5.


    Mukesh Ajmera

    Wednesday, July 25, 2012 9:34 AM
  • Hi Mukesh,

    Thanks for your reply...

    I am not able to find my application under c:\program Files

    Can you please help me?

    Wednesday, July 25, 2012 10:05 AM
  • Hi Santhosh,

    use below line for StartProgram

    <StartProgram>C:\Program Files (x86)\Internet Explorer\iexplore.exe</StartProgram>

    For more information :

    http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/4eb67204-2e09-4ead-9fe4-49815ebb3602/


    Mukesh Ajmera

    Wednesday, July 25, 2012 10:37 AM