To convert the project from using the built-in web server to the local IIS
server:
Remove the project from the solution.
Create the virtual directory in IIS.
In the solution Add Existing Website
I don't really what happens when you add a web deployment project to a
solution and click the debug button for the website. It looks like it runs
the webdeployment project even if it is not listed as a dependency for the
website.
I don't pretend to know what's going on in MsBuild. But I know somewhere in
there it deletes all the files and directories in the deployment directory.
If I am using the built in server and the deployment directory is .\debug;
who cares.
However, if I am using local IIS the deployment directory and the location
of my source files would be the same location because their is no debug
directory?
If I click debug on the website this is what the output is. I am guessing
the webdeployment project is actually running because of the error message
which is associated with an "AfterBuild" task.
------ Build started: Project: Util, Configuration: Debug Any CPU ------
Util -> D:\DotNet2005\Web_Utility\Util\bin\Debug\Util.dll
------ Build started: Project:
http://localhost/Hr-Auth/, Configuration:
Debug .NET ------
Validating Web Site
Building directory '/Hr-Auth/'.
Validation Complete
------ Build started: Project: Hr-Auth_deploy, Configuration: Debug Any CPU
------
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v
/Hr-Auth -p D:\DotNet2005\WebAuthentication_Solution\HR-Auth -u -f -d
D:\DotNet2005\WebAuthentication_Solution\Hr-Auth_deploy\Debug\
Running aspnet_merge.exe ...
C:\Program Files\MSBuild\Microsoft\WebDeployment\v8.0\aspnet_merge.exe
D:\DotNet2005\WebAuthentication_Solution\Hr-Auth_deploy\Debug -o
Hr-Auth_deploy -debug -copyattrs
Successfully merged
'D:\DotNet2005\WebAuthentication_Solution\Hr-Auth_deploy\Debug'.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -pef
connectionStrings .\Debug\ -prov HrCustomProvider
Encrypting configuration section...
The configuration for physical path
'D:\DotNet2005\WebAuthentication_Solution\Hr-Auth_deploy\Debug\.\Debug\'
cannot be opened.
Failed!
D:\DotNet2005\WebAuthentication_Solution\Hr-Auth_deploy\Hr-Auth_deploy.wdproj(61,5):
error MSB3073: The command
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -pef
connectionStrings .\Debug\ -prov HrCustomProvider" exited with code 1.
Done building project "Hr-Auth_deploy.wdproj" -- FAILED.
------ Build started: Project: D:\...\Documentation\, Configuration: Debug
..NET ------
Validating Web Site
Building directory '/Documentation/'.
Validation Complete
------ Build started: Project:
http://localhost/Hr-AuthTest/, Configuration:
Debug .NET ------
Validating Web Site
Building directory '/Hr-AuthTest/DenyEveryOne/'.
Building directory '/Hr-AuthTest/'.
Validation Complete
========== Build: 4 succeeded or up-to-date, 1 failed, 0 skipped ==========
The wdproj file:
<!--
Microsoft Visual Studio 2005 Web Deployment Project
http://go.microsoft.com/fwlink/?LinkId=55111
-->
<Project DefaultTargets="Build"
xmlns="
http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == ''
">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.60403</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A2B26EC0-7705-4CB1-AEDF-DC8B48F17398}</ProjectGuid>
<SourceWebPhysicalPath>..\HR-Auth</SourceWebPhysicalPath>
<SourceWebProject>{B1452975-9F98-4201-A09F-761CDCAA608A}|
http://localhost/Hr-Auth</SourceWebProject>
<SourceWebVirtualPath>/Hr-Auth</SourceWebVirtualPath>
<SourceWebMetabasePath>/LM/W3SVC/1/ROOT/Hr-Auth/</SourceWebMetabasePath>
<SccProjectName>"%24/VS05/WebAuthentication_Solution",
HDMAAAAA</SccProjectName>
<SccLocalPath>..</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>MSSCCI:Microsoft Visual SourceSafe</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>.\Debug</OutputPath>
<EnableUpdateable>true</EnableUpdateable>
<UseMerge>true</UseMerge>
<SingleAssemblyName>Hr-Auth_deploy</SingleAssemblyName>
<UseWebConfigReplacement>false</UseWebConfigReplacement>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Release|AnyCPU' ">
<DebugSymbols>false</DebugSymbols>
<OutputPath>\\hrInt2\E%24\Inetsrv\wwwroot\HrAuth\</OutputPath>
<EnableUpdateable>true</EnableUpdateable>
<UseMerge>true</UseMerge>
<SingleAssemblyName>Hr-Auth_MergedAssembly</SingleAssemblyName>
<UseWebConfigReplacement>true</UseWebConfigReplacement>
<ValidateWebConfigReplacement>true</ValidateWebConfigReplacement>
<DeleteAppDataFolder>true</DeleteAppDataFolder>
</PropertyGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Web_Utility\Util\Util.csproj">
<Project>{4FD447AA-FF03-4D6D-8F75-6898F6855BE5}</Project>
<Name>Util</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
</ItemGroup>
<ItemGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<WebConfigReplacementFiles
Include="ConfigFiles\appSettings.Release.config">
<Section>appSettings</Section>
</WebConfigReplacementFiles>
<WebConfigReplacementFiles
Include="ConfigFiles\authentication.Release.config">
<Section>system.web/authentication</Section>
</WebConfigReplacementFiles>
</ItemGroup>
<Import
Project="$(MSBuildExtensionsPath)\Microsoft\WebDeployment\v8.0\Microsoft.WebDeployment.targets" />
<Target Name="AfterBuild">
<RemoveDir Directories="$(OutputPath)/ConfigFiles" />
<Exec WorkingDirectory="$(OutputPath)"
Command="$(MSBuildBinPath)\aspnet_regiis.exe -pef connectionStrings
$(OutputPath) -prov HrCustomProvider" />
</Target>
</Project>