4 ways to fix error AADSTS65001 (The user or administrator has not consented to use the application)

Azure AD Login error

Fixing issues with Azure AD authentication for Enterprise applications can be tricky. This article contains multiple different fixes to an issue, where granting admin consent has somehow failed. Not all of the different solutions will work for all situations, though! That’s why I included a couple of different options to try… 🙂

Why do you even get issues with Admin Consent (like AADSTS65001)?

You’re trying to add or use an app, that requires such permissions from your tenant, that can only be granted by an administrator. Typically this app has to be added by a global administrator. If it’s an enterprise application, it could also be in an invalid state after someone tried adding the app without sufficient permissions.

Our investigation was focused on a mobile app, that’s deployed as an enterprise app. Most of the things should apply for web-based apps or console programs or whatever else you’re deploying, too.

The whole error might look something like this: Continue reading

Fixing the “For security reasons DTD is prohibited in this XML document.” issue

"For security reasons DTD is prohibited in this XML document. To enable DTD processing set the ProhibitDtd property on XmlReaderSettings to false and pass the settings into XmlReader.Create method."

This post describes a couple of ways to fix the issue “For security reasons DTD is prohibited in this XML document”. At least for me, it appeared when trying to access SharePoint Online using Powershell or a console program using OfficeDev.PnP (which in turn uses CSOM).

Error

When running any piece of code, whether in PowerShell, .exe console or anything else than in the code behind relies on .NET Framework, you get an error like this:

Continue reading

Fixing Lenovo T460S Wifi connectivity issues (removing the evil versions of Intel Dual Bank Wireless-AC 8260 driver)

I recently received a new work laptop – Lenovo T460S. A cute little thing with impressive performance and reasonably good battery life. However, what people frequently complaing about online in regards of this laptop, is its absolutely, horribly awful wifi. This, in turn, is probably caused by it’s bad wifi chip, Intel Dual Bank Wireless-AC 8260. And they’re right – it’s a load of crap.

Continue reading

Fixed: Cannot use JSX unless the ‘–jsx’ flag is provided

Typescript & React.JS

This blog post is about fixing issues related to building a project with TypeScript files. Basically, if your jsx or tsx -files are not getting built to js-files (which is what the browser understands) in Visual Studio’s build, this post might solve the issue for you.

Description

While converting a project using React.js to TypeScript (and, hence, to use .ts and .tsx files instead of .js and .jsx) I stumbled upon this error:

The project would not build a .tsx-file with ReactDOM.render(…) in it. This is a huge issue, of course, as my JavaScript-files would not update during the deployment. This means, that all of the code in TypeScript and React is not ran in the browser.

Continue reading

Duplicate object values in ASP.NET MVC DisplayTemplates? Easy fix.

Duplicate String values

Are you getting duplicate object values (or whatever those Objects output in ToString())? Eh, so was I. Found a fix, though.

Description

Okay – I just ran into one of my more stupid mistakes since.. Well, since forever.

I had made some quick and simple edits in String.cshtml displaytemplate (among quite a few other edits before building again and seeing what happened), as I added support for Enum values there. After that I started getting duplicate values for String-typed properties. 

Apparently, mistakes were made.

Solution

Luckily, this was easy to fix (but still worth documenting): I had added the code for handling Enum-values, and also changed “@model String” -declaration to awful “@Model object” -one. Changing the type was supposed to happen, but capitalizing the model messed up my DisplayTemplate. Instead of casting the model to object, I was simply calling Model at the start of the template (basically, that was a shorthand for Model.ToString()), hence the “String object String”-kind of duplicate values on DisplayTemplate.

Continue reading

Powershell Error: Cannot uninstall the LanguagePack 0 because it is not deployed.

Powershell: languagepack 0

Thi s post offers a solution to the very non-descriptive SharePoint error message “Cannot uninstall the LanguagePack 0 because it is not deployed”, which might appear while trying to update a wsp solution.

Symptoms

Assume you’re trying to install, update or uninstall a SharePoint solution (.wsp package) using PowerShell-commands Install-SPSolution, Update-SPSolution or Uninstall-SPSolution (respectively). Operation fails with the following (or similar) error:

I have actually seen this also in the form of “Cannot uninstall Language Pack 0 because it is not deployed”, but I think the other form of the error is the one that pops up in the PowerShell.

Powershell: languagepack 0

In Central Admin the solution is in Error state.

151117_ca

Solution

You can find quite a lot of solutions online, but they weren’t really working for me. I tried restarting services, removing the package and meddling with the dll-files, but to no avail. However, the actual “last operation details” on the CA page hinted that the problem was in fact in one of the features. The feature in question included some content types, and toying around with them is like playing baseball with hand grenades, so you have to tread carefully in cases like these.

Continue reading

Malformed web.config killing your ASP.NET-application or SharePoint (“Server Error in ‘/’ Application” or “Parser Error”)

Malformed web.config

Symptoms

Once you navigate to your site, you only get en error like this:

Server Error in ‘/’ Application.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Index was outside the bounds of the array.

The next few rows (source of the error) seem to vary wildly, but they’re something like this:

Parser Error

Line 3: <WebControls:XmlUrlDataSource runat=”server” AuthType=”None” HttpMethod=”GET”>
Line 4: <DataFileParameters>
Line 5: <WebPartPages:DataFormParameter Name=”RequestUrl” ParameterKey=”RequestUrl” PropertyName=”ParameterValues”/>
Line 6: </DataFileParameters>
Line 7: </WebControls:XmlUrlDataSource>

Continue reading

Identifying IE11 compatibility mode in SharePoint

IE11 compatibility view emulator

This post describes how to figure out if IE11 has jumped in the compatibility mode and therefore screws up your CSS.

Compatibility view now and before

Microsoft has been pretty keen on introducing new ways to handle browser compatibility and make IE behave in even stranger ways that it usually does by switching it to compatibility mode. There are a few reasons this could happen, but perhaps the most usual one in SharePoint’s case is that IE identifies the SharePoint site to be located in intranet zone, or it’s set to that zone or the list of sites to display in compatibility mode via a group policy.

Before IE11 the switch was reasonably easy to notice – there would be a button/icon similar to this on the address bar, when the browser was in compatibility mode:

IE 10 compatibility mode

IE 10 compatibility mode

However, in IE11 Microsoft has removed the icon leaving us in the dark about whether the page is in compatibility mode or not. We COULD check the compatibility view and security zone settings to find out the mode, but there’s a better way, too. Now, we must check the developer tools (F12 brings them up) to see, which document mode is activated. IE11 in compatibility view may show us something similar to this:

IE11 compatibility view emulator

IE11 compatibility view (emulator)

But wait a minute – what if you can’t access the end user browsers yourself? Before it was pretty easy – you could just ask the end user to check for the compatibility view icon, as it was easily visible on the address bar, but nowadays you’re mostly out of luck – instructing the end users to actually use developer tools is probably going to be difficult. However, there’s a workaround for this.

Continue reading

“File not found”-error when trying to activate custom feature on SharePoint

File not found

This post is about fixing on of the most non-spesific errors you can get when activating features on SharePoint “File not found”.

Problem

“File not found” is one of the more annoying errors one can stumble upon when trying to activate a feature.

File not found

File not found

There are quite a few reasons that can cause this error, but after the obvious ones (some files failing to be included in the package, botched wsp deployment, errorenous urls in event receiver) one thing to check might be the alternate access mappings. Continue reading