Azure Webjobs publish error (active directory) - azure

When I try to publish an azure webjob, I get the following error:
An error occurred while creating the WebJob schedule: Could not load type 'Microsoft.IdentityModel.Clients.ActiveDirectory.ActiveDirectoryAuthenticationException' from assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.16.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
The same question is asked in Visual Studio 2015 Publish WebJobs Issue, but the accepted answer does not solve my case.
I tried to add the nuget package for ActiveDirectory version 2.16, but that didn't solve it either.

There is now a better way of scheduling WebJobs using CRON expressions, which is simpler and avoids all the Scheduler issues.
I have added a new answer to the existing question, to keep everything in context of the original answers.
See details on Visual Studio 2015 Publish WebJobs Issue

I found the solution as i have been stuck in this error for a while.
The issue turns to be that it is a bug in Visual Studio 2015 Update 3. It uses old webjobs publishing tools even if you have newer NuGet packages.
After looking at the source of the problem in the output window, Visual Studio build tools were looking for an older webjobs publishing package ver. 1.0.3 while i have 1.0.12 on my pc.
Below screen shot shows that my csproj file contains 5 publishing packages.Everytime i deploy it checks for the first condition and uses 1.0.3 while i want the build tools to use 1.0.12!
The fix for this is to unload the project in Visual Studio 2015, Edit the .csproj file and delete the older NuGet publish packages from the build targets.
Rebuild, Publish, The webjob will be deployed to Azure and a scheduler will be created with no issues!
Hope this helps.

Related

Azure Devops pipeline is not picking latest visual studio version

'Visual studio build solution task' in the Azure pipeline has latest visual studio version selected. However from the console log I can find it is not selecting the latest version (2022) instead it is selecting the 2017 version.
Even in the console log of my previous task (Nuget restore) I can see it is picking only the 2017 version.
Is there a way that I change the solution to Visual studio version 2019.
Note: Main reason I want to use 2019 version is because current version of my MSBuild is not compatible with VS version 2017. Because of this my pipeline is failing.
Is there a way I can change the VS version in Azure Devops pipeline. Can someone guide me please?
Is there a way I can change the VS version in Azure Devops pipeline?
You can use a MSBUILD task and switch from Version to Specify Location and insert the path to the msbuild.exe of VS2022.
Ex:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\msbuild.exe.
Look at the screenshot below:
Note: Please make sure your path is correct in the MSBuild.exe task.
Since you are not providing a basic pipeline yml file (maybe you are using classic instead of yml?), we can only guess.
Is there a possibility that the NuGetCommand task is finding a solution file in your repo that references the 2017 version of VS?
NuGetCommand will "restore" (install) the version it finds unless something else overrides.

Visual Studio publish to azure existing apps error

Getting this error when I select a "publish target" in VS 2015 update 3. Had a look for a while online but didn't see anything, so any help would be appreciated if you could point me in the right direction.
An error has occurred while processing the request: Method 'StopRemoteProfiler' in type 'Microsoft.VisualStudio.Web.WindowsAzure.AzureWebSite' from assembly 'Microsoft.VisualStudio.Web.WindowsAzure.Impl, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' does not have implementation
I updated to the to Azure sdk 2.9.6 last night because of a different issue but related where there was no error, but no existing apps were listed.
I can confirm that this works on my work computer and I have existing apps on Azure, but not working on my home computer.
I am a bit loath to uninstall and reinstall VS, so any help would be appreciated. Of course, if the only solution is to reset, then so be it.
Thanks,
Jarrod
I faced the same problem. This is what worked for me.
I updated the "Microsoft .NET Core 1.0.1 - VS 2015 Tooling Preview 2" by going to Menu -> Tools -> Extensions and Updates -> Updates -> Visual Studio Gallery. It shows all the available updates for your version of studio. Select the component to update. It should download a file named "DotNetCore.1.0.1-VS2015Tools.Preview2.0.3.exe" or something similar. When you run this file, if you have the software already installed then select the repair option. It will ask you to close any running instances of Visual Studio, also make sure you have internet connection.
Also if you are using Web Deploy to publish your app make sure you have Microsoft Web Deploy v3 or higher installed or you will get error. You can do it using Microsoft Web Platform Installer.
Hope it helps.

Opening Azure DataFactory Projects in VS2015

I am working on a solution that apparently was created in VS2013. I have VS2015 installed. There are a number of .dfproj files included in the solution. When I attempt to load the solution it tells me that .dfproj files are unsupported. I have the latest Azure SDK installed. I also located a download for the "Azure Data Factory Visual Studio Tools", however when I attempt to install it, it tells that it is incompatible with VS2015. I have been unable to locate a version of those tools intended for 2015. If someone could point me in the right direction to solve this dilemma, I would be greatly appreciative.
I hope, I am not too late to answer your question.(almost two years)..
I faced similar issue as you mentioned in question. In my case I was unable to open .dfproj file. I downloaded Microsoft Azure DataFactory Tools for Visual Studio 2015 from Microsoft market place. Installed it to my machine. Now .dfproj file is loading.
Microsoft VS Professional 2015
VS2015 version: 14.0.25431 update 3

Visual Studio 2015 can't start IIS Express

When I am trying to run an ASP.Net Core project in Visual Studio 2015, a Microsoft Visual Studio dialog appears "The project doesn't know how to run the profile IIS Express".
Does anyone know anything about this message, or how to fix it? I've searched Google and the MSDN. There's nothing in the build logs, or the Windows event log.
This dialog showed up for me when I had migrated a project from dotnet RC1 to RC2.
Before the fix I could still run it using dotnet run and from Visual Studio choosing the profile other than "IIS Express".
I had misread this guide and forgot the .Web
\DNX\Microsoft.DNX.targets –> \DotNet.Web\Microsoft.DotNet.Web.targets
After fixing this and restarting Visual Studio(not sure if needed) I could run the project using the IIS Express profile.
Should also be noted that as per the comments, adding .Web in the top level node is required in the xproj. <Project Sdk="Microsoft.NET.Sdk"> should be <Project Sdk="Microsoft.NET.Sdk.Web">.
In my case the issue was solved after added the ASP.NET and web development tool extension to my VS instalation.
To clarify the answer from hultqvist, it is a problem with the xproj. To fix it, edit the xproj directly and change this
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets"
Condition="'$(VSToolsPath)' != ''" />
to this
<Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets"
Condition="'$(VSToolsPath)' != ''" />
That is, insert Web twice.
There is an associated issue in the aspnet tooling repo.
I had the same issue and found a very simple solution for Visual Studio 2017. In Visual Studio 2017 go to Solution Explorer then right click on your project file. In the menu you will see "Set as StartUp Project". If you can select it then select it. Now run your project again.
I had a similar issue but with "MyProjectName" instead of IIS Express.
In my case, I was trying to start as a standalone application, so I cleaned the launchSettings.json
I inadvertently changed the "commandName" parameter from "Project" to "MyProjectName" and that caused the popup to show up.
Resetting it back to "Project" solved my issue, silly me 😁
I had a similar issue, In my case ASP.NET and web development is enabled but Development time IIS support is not checked in the optional sections.
Once I enable the Development time IIS support solved my issue.
You can get this error with RTM if <BaseIntermediateOutputPath gets corrupted or is incorrect in your .xproj file.
I had this same issue and after digging around for a while I discovered that I had dotnet preview v1.0.0-preview2 installed under Programs Files (x86) and a non-preview version in x64. I think VS is launching the x86 (preview) version but expecting to see the full version. To fix this, I did the following.
from programs and feature uninstall every visible dotnet core. (note: this did not remove the x86 preview)
go to https://www.microsoft.com/net/download/core#/sdk and install BOTH x86 and x64 SDK packages
open command line and from the root directory check run: dotnet --version (at the time of writting it was 1.0.4
fire up .net core project in VS 2017 and run.
When I did all of the above, I was able to start up the site in IIS Express from VS.
This happened to me after a failed update of visual studio 2017 15.9.4
Setup completed with warnings and when I checked the problems saw that .NET core SDK 2.1 installation is failed.
I will try to install it manually.
Otherwise currently the only solution I found is to uninstall visual studio and re-install it.
In visual Studio 2017, i fixed this error by doing the following two steps.
I went to add or remove a program in windows, and deleted everything ending with ".net". I then reinstalled them in the visual studio installer. Then loading the project again produced a new error, which condiosluzverde provided the solution to here:
How Can I Fix the Microsoft Visual Studio Error: "Package Did Not Load Correctly"?
Same thing happened to me, my project was working fine. I didn't do any RC1 to RC2 update & this popup appeared from nowhere.
I fixed the problem by updating visual studio. You can also consider repairing VS.

Invoke a publish from msbuild for visual studio 2012

For VS2010 and before I was utilizing Web Deployment Projects (WDP) to help package my website for production deployment. I had a MSBuild script that compiled the solution in release mode. An output of that was production ready website files compiled and cleaned by the WDP.
I see for 2012 WDP have been removed, and a new tab has been created in the properties for the web application. The options are the same, but now the invocation of this is done via the Publish option (before you just compiled in release mode).
So the question is this. From an MSBuild script, how do I invoke a Publish operation? I found some old posts that...
msbuild /target:publish
would do the trick. But that doesn't seem to work in 2012.
Also, I tried in my msbuild task...
<MSBuild Properties="Configuration=Publish;"
StopOnFirstFailure="true"
Projects="$(BuildDirectory)\MySolution.sln"></MSBuild>
...but msbuild just reported "unknown configuration".
How can I have msbuild run the publish option from the command line?
It appears that there are now some other options for publishing from the command-line. Specifically something along the lines of the following seems possible now with some RC updates to Visual Studio 2012.
msbuild mywap.csproj /p:DeployOnBuild=true;PublishProfile=MyProfileName
For more details check out this post by Scott Hanselman and check out the section on Publishing.
I wasn't able to get the publish to run, but looking at the output from Visual Studio I think I have found an alternate solution. Turns out the obj\Release\AspnetCompileMerge folder has a deployable and clean version of the project. It contains byte identical files to the final output folder.
I did have to change my msbuild script to include the DeployOnBuild option...
<MSBuild Properties="Configuration=Release;DeployOnBuild=True;"
StopOnFirstFailure="true"
Projects="$(BuildDirectory)\BigWave.ALL.sln"></MSBuild>

Resources