How to convert a Class Library project to a Web Application project?

I did this by hand today in Visual Studio 2005 because it seemed easier and faster than the above. I just diffed a working web application .csproj file with my class library to determine the relevant differences. Based on that, I made the following changes. Keep in mind that it may be different for other versions or your individual project.

1) Right after the <ProjectGuid> element near the top, I added

<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> 

2) I removed <ProjectType>Local</ProjectType>
3) At the bottom of the file, right before the closing </Project>, I added

<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v8.0\WebApplications\Microsoft.WebApplication.targets" />
      <ProjectExtensions>
        <VisualStudio>
          <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
            <WebProjectProperties>
              <UseIIS>False</UseIIS>
              <AutoAssignPort>True</AutoAssignPort>
              <DevelopmentServerPort>3291</DevelopmentServerPort>
              <DevelopmentServerVPath>/</DevelopmentServerVPath>
              <IISUrl>
              </IISUrl>
              <NTLMAuthentication>False</NTLMAuthentication>
            </WebProjectProperties>
          </FlavorProperties>
        </VisualStudio>
</ProjectExtensions>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)