Publish to Azure fails with " Unrecognized link extension 'contentLibExtension'" Error - azure

I am trying to publish ASP.NET MVC 6 App to Azure with Visual Studio 2015 CTP. And getting the following error
Publishing with publish method [MSDeploy]
Calling msdeploy with the command: ["C:\Program Files (x86)\IIS\Microsoft Web Deploy\msdeploy.exe" -source:IisApp='C:\Users\*****\AppData\Local\Temp\AspNetPublish\NgCalendar-28\wwwroot' -dest:IisApp='ngcalendar',ComputerName='https://ngcalendar.scm.azurewebsites.net/msdeploy.axd',UserName='$ngcalendar',Password='{PASSWORD-REMOVED-FROM-LOG}',IncludeAcls='False',AuthType='Basic' -verb:sync -enableLink:contentLibExtension -enableRule:DoNotDeleteRule -retryAttempts:2 ]
INVOKEPOWERSHELL(0,0): Error : Unrecognized link extension 'contentLibExtension'.
INVOKEPOWERSHELL(0,0): Error count: 1.
Not sure where it's coming from and how to tweak it.

Try deselecting "Publish using PowerShell script" checkbox in publish Settings
It worked for me

I had the same error.
In my case the problem was an old version of "msdeploy.exe".
After some searching I found one "msdeploy.exe" in the folder "C:\Program Files (x86)\IIS\Microsoft Web Deploy\msdeploy.exe" which caused the problem and another one in the folder "C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe".
As I don't know how to change the path in Visual Studio to the newer version, I just saved the old folder and copied the complete content of the new folder into the old.
After this everything worked for me and I was able to publish to Azure :)
Hope this helps.

Related

Unable to build Compiled Azure Function in VSTS (Error MSB4019)

I have created an Azure Function using the latest build of visual studio 2017 (15.3.1).
This build allows me to do the:
New Project > Azure Function App approach
This produces a .csproj (not a .funproj file) and it's doesn't come bundled with a website or anything. I've tried .Net 4.6 and 4.6.1 as the target framework and neither have worked.
I get the following error in VSTS:
C:\Users\Builder.nuget\packages\microsoft.net.sdk.functions\1.0.2\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Publish.props
(13, 3)
C:\Users\Builder.nuget\packages\microsoft.net.sdk.functions\1.0.2\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Publish.props(13,3):
Error MSB4019: The imported project "C:\Program Files (x86)\Microsoft
Visual
Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\Sdk\Sdk.Props"
was not found. Confirm that the path in the declaration is
correct, and that the file exists on disk.
There is no node in my .csproj file so I am not sure where it is getting that from.
I'm using the latest NuGet option in VSTS, I'm using the Latest VS Version option as well.
The build steps are:
Get Sources
NuGet Restore
Build Solution (MSBuild.exe exited with code '1' every time)
Is there any way to build (and then release) compiled .Net functions in VSTS at the minute?
I was able to solve this by swapping the build agent from the "Default" group to the latest, "Hosted VS 2017" group, and that has compiled fine.
Looks like the machine is missing the latest dotnet cli. I'm not too familiar with VSTS build machines, but you'd need to get that on there somehow https://www.microsoft.com/net/download/core

Deploy .NET Core ASP.NET Website - HTTP Error 502.5 - Process Failure

I'm trying to publish the template project "ASP.NET Core Web Application (.NET Framework)" from Visual Studio 2015 to IIS.
I use the Visual Studio publish to File System feature.
I'm using Windows 10.
I followed the guide from here.
I set up a website in IIS and changed the Application Pool .NET CLR Version to No Managed Code
I instaled the .NET Core Windows Server Hosting bundle
I restarted my machine.
I get this error:
I added a logs folder, but no logs get created.
Any ideas on how I can solve this?
EDIT:
Output of running the .exe from powershell:
PS C:\TestCoreWebsite> .\Web_CoreWebNetFramework.exe
Hosting environment: Production
Content root path: C:\TestCoreWebsite
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.
Then I navigate to http://localhost:5000 and the sample site works.
Found the solution:
In the root web.config change:
processPath="%LAUNCHER_PATH%"
to:
processPath=".\Web_CoreWebNetFramework.exe"
I ran the following command in cmd
C:\fullpath\dotnet C:\fullpath\PROJECT.dll
on the command prompt, which gave me a much more meaningful error:
"The specified framework 'Microsoft.NETCore.App', version '1.0.1' was
not found. - Check application dependencies and target a framework
version installed at: C:\Program
Files\dotnet\shared\Microsoft.NETCore.App - The following versions are
installed: 1.0.0 - Alternatively, install the framework version
'1.0.1'.
I Installed the correct net core and the project worked correctly
With VisualStudio 2017, open up the .csproj file and add to the first block:
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
Usually the result will be:
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
</PropertyGroup>
For whoever faces the same issue as mine(running well in VS but got above issue when deploying into Local IIS), I missed Setting Environment Variable and It works after I added the Setting Environment Variable
Ref: How to add Setting Environment Variable in IIS

Package / Publish error on Azure

I've recently upgraded an Azure Project from Azure SDK 1.6 (Visual Studio 2010) to Azure SDK 2.0 (Visual Studio 2012). The project will build with no errors or warnings on the local machine. I can debug on the local machine, but I cannot package or get a build on the build server. The error I get is:
error MSB4057: The target "PipelineTransformPhase" does not exist in the project.
I've confirmed that the C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplications.targets file exists locally and on the build server.
The original project pointed to the \v10.0\ path and I manually changed that to the \v11.0\ path trying to resolve the error with no luck.
I have noticed that when project is not able to access Microsoft.WebApplications.targets file it usually says "The target "PipelineTransformPhase" does not exist in the project."
You need to import Microsoft.WebApplications.targets file into the project. You can do it by adding following line in your project.
<Import Project="C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets" />
When importing Microsoft.WebApplication.targets into the project file, make sure you don't set explicit Condition="false". I have seen similar error when Microsoft.WebApplication.targets was imported to the project along with Condition="false".
One more thing to consider when importing Microsoft.WebApplication.targets into project file, always make sure that default variable $(MSBuildExtensionsPath32) is set to "C:\Program Files (x86)\MSBuild\".

How to determine if MSBUILD Arguments were executed for TFS Build Definition

I am using Team Foundation Service 2012, with a build controller hosted internally so I can deploy apps to our web servers. I setup the Build Definition, and am using the my Debug configuration, and have supplied the following MSBUILD arguments.
/p:DeployOnBuild=true /p:DeployTarget=MSDeployPublish /p:MSDeployPublishMethod=WMSVC /p:MSDeployServiceUrl=https://myserversname:8172/msdeploy.axd /p:AllowUntrustedCertificate=true /p:DeployIisAppPath="somesite.ourdomain.com" /p:Username=na\svc-users /p:Password=PASS /p:VisualStudioVersion=11.0
The solution builds just fine, I get no warnings, or errors. When I go my deployment server, the application is empty. I have setup the permissions to the web application folder, and inetsrv folder. I also installed/configured web deploy. If I am not getting any errors returned how can I tell what is going wrong with my Deployment? I have already checked the Event Logs on both the Build server, and the Deployment server, and neither have any errors or warnings. I can also do a publish from my dev machine and it works perfectly with the exact same parameters.
Copy these two folders, and their content, from your development environment to the build server:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications
These folders are a dependency which is caused by publishing through Visual Studio 2012. This dependency is referenced in the .sln file.
Unfortunately this means web deploy is failing silently.
Alternatively you could install Visual Studio on the build server but that would be a waste of a license.

Azure Emulator - Could not load file or assembly

All.
I've got Azure SDK 1.7 installed.
All the assemblies in the solution are compiled with 'Any CPU' set up. But one of them fails when i start the solution in Azure emulator on my machine.
The error is very strange: "Could not load file or assembly 'XXX' or one of its dependencies. is not a valid Win32 application."
It becomes more complicated to find the reason, cause on the other machine everything works fine. Also I have no error when deploy it to Azure environment.
Tried to start emulator using IIS Express 8 and full IIS. Also tried to enable 32bit apps support when hosted under full IIS. Converted project to use 1.8 SDK.
But with no success.
Here is also some info from Visual Studio General output. Seems, here is the reason for the issue.
Windows Azure Tools: Warning: Unable to delete file fr000001.xml.
Windows Azure Tools: Warning: Unable to delete file fr000002.xml.
Windows Azure Tools: Warning: Unable to delete file fr000001.xml.
Windows Azure Tools: Warning: Unable to delete file fr000002.xml.
Windows Azure Tools: Warning: Unable to delete file fr000001.xml.
Windows Azure Tools: Warning: Unable to delete file fr000002.xml.
Windows Azure Tools: Warning: Unable to delete file fr000001.xml.
Windows Azure Tools: Warning: Unable to delete file fr000002.xml.
Windows Azure Tools: Warning: Unable to delete directory deployment17(397)
Couldn't find the process that can create such behavior. Of course, tried to restart my machine and to remove all the readonly properties from project files.
Will be glad to see any possible solution.
Thanks in advance.
Ok. I've found the source of problem.
When installed RedGate .NET Reflector, it created environment variable with name DEVPATH.
It's value is: "C:\ProgramData\Red Gate.NET Reflector\DevPath"
I've looked through this path and found there obsolete dll for my project. As result, it searched for the reference as it performs with GAC and always found incorrect one.
Removed and everything works.

Resources