Web Deployment Project and Localhost

G

Guest

I have an asp.net project with an WebDeployment Project.

At the end of the msbuild file I put:

<Target Name="AfterBuild">
<Exec WorkingDirectory="$(OutputPath)"
Command="$(MSBuildBinPath)\aspnet_regiis.exe -pef connectionStrings
$(OutputPath) -prov HrCustomProvider" />
<RemoveDir Directories="$(OutputPath)/ConfigFiles" />
</Target>

This works fine if the webserver is the built in server.
However if I am using the localhost IIS server I get an error.
From the Output window:
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.

So I looked in my WebDeployment Project Property Pages
Configuration Properties: Compilation
Output Folder

It was set to .\Debug\

I am a little scared about changing the output directory to . because I
certainly don't want the source files to get deleted.

What should I do to get this to work.
 
S

Steven Cheng[MSFT]

Hi Chuck,

As for the Webdeployment project issue, how did you move the original VS
2005 TEST server based project to IIS hosted? Are you still using the same
solution(with the WEB deployment project) after you move the web project to
IIS?

If possible, you can tell me the detailed steps to create a web
project(with web deployment project) that can report the issue, I'd like to
perform some local test also.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
 
G

Guest

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>
 
G

Guest

Steven,

Here is the solution somehow in the solution properties under Configuration
Properties the Build check box for the deployment project was checked.
 
S

Steven Cheng[MSFT]

Thanks for the followup Chuck,

Sorry for the delayed response as I was on sick previously. Anyway, glad
that you've found a way to workaround the problem. If you need any further
help later, welcome to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top