IIS application creation fails with BTDF - biztalk

In Biztalk 2010 and Biztalk Deployment Framework 5.0 (BTDF) I want a virtual directory to be created.
I added the VDir sections in the .btdfproj file, but after deploy via the IDE (but also from the built MSI), I get these errors:
C:\Program Files (x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\
BizTalkDeploymentFramework.targets(1646,5):
error MSB4018: The "CreateVirtualDirectory" task failed unexpectedly.
C:\Program Files (x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\
BizTalkDeploymentFramework.targets(1646,5):
error MSB4018: System.Runtime.InteropServices.COMException (0x800700B7):
Cannot create a file when that file already exists.
(Exception from HRESULT: 0x800700B7)
I am using VS2010 (SP1), BTDF 5.0, WinServ2008R2 (64 bits), IIS6 backwards comp feature enabled. Even <UndeployIISArtifacts>true</UndeployIISArtifacts> does not help.

Solution found. It appears that a remove from the IIS 'Remove' doesn't delete all the files. A read this discussion: http://biztalkdeployment.codeplex.com/discussions/82081
I did this to resolve:
Imported all the cmdlets (right click Powershell icon on taskbar -> Import system modules)
Started Powershell, and put it in unrestricted mode:
Set-ExecutionPolicy Unrestricted
Add this command: Remove-WebConfigurationLocation -PSPath 'MACHINE/WEBROOT/APPHOST' -Name 'Default Web Site/[YOUR IIS APP]'
Replace [YOUR IIS APP] with your IIS application name to be removed.

Related

Publish fails in multiple processor build agent since roslyn files are locked by another project

I get the following error when I try building my solution in a multi core build agents.
C:\Program Files (x86)\Microsoft Visual
Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\Web\Deploy\Microsoft.Web.Publishing.Deploy.FileSystem.targets(96,5):
error : Copying file obj\Release\Package\PackageTmp\bin\roslyn\csi.exe
to
C:\buildAgent\work\f7321f5187869991\Deploy_output\www\bin\roslyn\csi.exe
failed. The process cannot access the file
'C:\buildAgent\work\f7321f5187869991\Deploy_output\www\bin\roslyn\csi.exe'
because it is being used by another process.
[C:\buildAgent\work\f7321f5187869991\src\Feature\VersionPruner\code\Sitecore.Feature.VersionPruner.csproj]
The msbuild command I use to trigger the build is
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin\MSBuild.exe" ..\MySolution.sln "/target:Rebuild" /verbosity:minimal /toolsversion:15.0 /nologo /maxcpucount /p:Configuration=%1 /property:DeployOnBuild="true" /property:DeployDefaultTarget="WebPublish" /property:WebPublishMethod="FileSystem" /property:DeleteExistingFiles="false" /property:publishUrl="%cd%\_output\www" /property:_FindDependencies="false" /p:BuildSourceFolder="%cd%\..\src" /p:BuildOutputBaseFolder="%cd%\_output\configs" /property:BuildOutputWWWFolder="%cd%\_output\www"
The solution builds successfully when maxcpucount property is set to 1.

Running Angular 4 + Core 2.0 on IIS failing to start up

I have an application written in ASP.Net Core 2.0 using the Visual Studio Angular 2 template that I can run successfully on my local IIS installation and local commandline but fails on Windows Server 2012 R2 Standard.
From my local command line I can run:
dotnet myApp.dll
And the application runs successfully until ASP.Net core 2.0. When I copy the deployed application to my 2012 server (where the Core 2.0 runtime as been installed), I cannot call the same dotnet command (both calls are from within the root deployment folder for the app myApp).
On my desktop, the result is a web site that is listening at 5000 (ASP.Net core 2's default port I'm assuming) when running from the published site locations.
However, when I run this same command on the server, I get the error:
Unhandled Exception: System.AggregateException: One or more errors occurred. (We
bpack dev middleware failed because of an error while loading 'aspnet-webpack'.
Error was: Error: Cannot find module 'aspnet-webpack'....
....
....
) ---> Microsoft.AspNetCore.NodeServices.HostingModels.NodeInvocationException:
Webpack dev middleware failed because of an error while loading 'aspnet-webpack'
. Error was: Error: Cannot find module 'aspnet-webpack'
When I look up aspnet-webpack from npmjs.com, I note that this module is "This NPM package is an internal implementation detail of the Microsoft.AspNetCore.SpaServices NuGet package" according to NPM.
I'm assuming that somehow my Core 2.0 install in missing or not able to reference Microsoft.AspNetCore.SpaServices, but at this point I'm not sure where I should be looking for this.
Thanks for any input.
Look at your system variables (right click My PC > Properties > Environment Variables). ASPNETCORE_ENVIRONMENT has to be set to either Staging or Production if you do not have the dotnet sdk installed.
Once you change that value, change it in your project (Properties > Debug tab) as well. Redeploy your project and restart your server. You should see the site working now.
Good luck!

Writing to IIS using Command Line

I am trying to install application using a script. This application creates a virtual directory under Default Web Site in IIS.
I have written this script. Is this right script or i am missing some thing.
cd C:\Users\Administrator\Desktop
msiexec /qb /i ZFPSetup.msi INSTALLLOCATION="C:\Program Files (x86)\Application" TARGETVDIR="ZFP" WIXUI_EXITDIALOGOPTIONALCHECKBOX=1 /l*v "C:\log.txt"
iisvdir /create Default Web Site ZFP C:\Program Files (x86)\Application\ZFP
call "C:\Program Files (x86)\Application\StartKaraf.bat" echo error
I am getting below error:
MSI (s) (28:D0) [04:25:58:897]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIF886.tmp, Entrypoint: WriteIIS7ConfigChanges
WriteIIS7ConfigChanges: Error 0x80070002: Site not found for create application
WriteIIS7ConfigChanges: Error 0x80070002: Failed to configure IIS application.
WriteIIS7ConfigChanges: Error 0x80070002: WriteIIS7ConfigChanges Failed.
CustomAction WriteIIS7ConfigChanges returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Error 0x80070002: Site not found for create application
Maybe this is caused by the lack of quotes, so instead of:
... iisvdir /create Default Web Site ...
Try:
... iisvdir /create "Default Web Site" ...
Using simple batch files is not the best way to go about configuring IIS. For system administration tasks such as this, Microsoft created PowerShell.
Check out how to configure IIS using PowerShell here: http://www.iis.net/learn/manage/powershell.
Here's an example of how to use PowerShell to create a virtual directory in IIS:
PS IIS:\> New-Item 'IIS:\Sites\Default Web Site\DemoVirtualDir1' -type VirtualDirectory -physicalPath c:\test\virtualDirectory1
The code above uses the PowerShell Snap-In for Creating Applications.
Good luck!

Change launch path of Visual Studio 2010 Web Server

How I can tell Visual Studio 2010 to launch built in web server from a different location. Is there a registry settings somewhere that I can modify or some how change the Debug -> Start Debugging menu item command?
From
C:\Program Files (x86)\Common Files\microsoft shared\DevServer\10.0\WebDev.WebServer20.exe
To
C:\Program Files\Common Files\microsoft shared\DevServer\10.0\WebDev.WebServer20.exe
If you've facing the problem in connection with Oracle integration with ASP.NET in Windows 7 64 bits, then relax... XD
That's the solution (I'm using Visual Studio 2010 32 bits):
First of all, follow the steps here:
System.Data.OracleClient requires Oracle client software version 8.1.7
Then apply these steps:
Copy the directory of your webserver (typically in "C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\10.0") to "C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0";
Open cmd, navigate to directory pasted in step 1 and start the web server (in my case "WebDev.WebServer40") pointing to the directory of your project (be careful, because this path cannot contain parenthesis, that causes the Oracle Bug 'ORA-06413: connection not open' as can be see described here);
If you want to debug your application, change the default URL to the URL of your started server in Visual Studio. In Solution Explorer go to your project > right click > properties > web > in "Servers" section select "Use Custom Web Server" and place the URL that your server are running on. After this, start debug and be happy =D
For those who are still facing this issue in 2016 like me,
you can change step1 of Caique Lemos's answer to:
mklink /J c:\ProgramsX86 "C:\Program Files (x86)"
And use c:\ProgramsX86\... for step2
Also, run as administrator can skip setting the folder permissions in the link above.

Web Deploy script error - msdeploy.exe is not found on this machine

I'm trying to execute a web deploy script on a clean build Windows Server 2008 R2 machine and getting the following error:
ERROR: The system was unable to find the specified registry key or
value. msdeploy.exe is not found on
this machine. Please install Web
Deploy before execute the script.
The package was created in VS2010 and executes fine on my development box (as always!). If I import the package on the server through IIS everything works fine.
Web Deploy has been installed on the server through the Web Deployment Tool 2.1 via the Web P.I and I've verified the inclusion of msdeploy.exe. I'm running the script through the "IIS Extensions/Web Deploy Command Line" start menu item so I'm guessing that the correct paths should be set. I've also tried it as Administrator with the same error.
Any help greatly appreciated.
Copied from here:
There is an error with the way Microsoft’s Web Deploy 2.1 application creates command line packages from Visual Studio 2010.
If you create a package to publish and then try to run the msdeploy.exe command line publishing tool it on a production server running IIS then you may receive the following error:
ERROR: The system was unable to find the specified registry key or
value. msdeploy.exe is not found on this machine. Please install Web
Deploy before execute the script.
Assuming that you actually have installed Web Deploy from http://www.iis.net/download/WebDeploy then the error may be caused by an incorrect registry path variable in the .cmd file that Visual Studio creates.
Open up the .deploy.cmd file that is part of your deployment package in a text editor and look for the following code block:
if "%MSDeployPath%" == "" (
for /F "usebackq tokens=2*" %%i in
(`reg query "HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1" /v InstallPath`)
do (if "%%~dpj" == "%%j" (
set MSDeployPath=%%j
If you have installed Web Deploy 2.0 or higher, then the error is caused by the registry query to HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1. If you open up regedit on your production server you’ll find that the appropriate key is actually HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\2.
Change the reference in the.deploy.cmd file and you’ll be able to successfully run the deployment package.
I have the same problem. Installed WebDeploy_2_10_amd64_en-US. Running the Deploy Command Line I get the same erorr. However, in IIS (version 7) I could use an option import application. With this option (right side of the window in the actions toolbar) I was able to import the application deployment package zip file. All settings were imported correctly except for the application pool. I only had to adjust that and everything was running fine.

Resources