How to show any page in a pop-up in SharePoint

This ages old trick deserves to be published – since it makes it easy to quickly show info from pretty much any another page on pretty much any classic SharePoint page (in a SharePoint-compatible pop-up). So, here goes:

Using SharePoint’s JavaScript library to open an arbitrary pop-up

Yes – SharePoint contains all the functionality out-of-the-box, and you almost don’t have to do anything yourself! Let’s see how this works.

Continue reading

Opening a web part page in maintenance mode

SharePoint doesn't work as intended

Can’t access a web part page because of a broken web part? Yeah, that’s a classic issue – and it’s nicely ported into Modern world, too! In these cases, web part page maintenance mode comes in handy!

There’s a query parameter available for accessing it. For whatever reasons, it’s different for Classic and Modern mode, though. Why make things easy if you can make them dificult, right? 🙂  Continue reading

Troubleshooting: Anonymous access on a public SharePoint site collection failing

SharePoint vs. Anonymous

Ah, everyone’s favorite, classic topic! Debugging SharePoint On-Premises configuration issues is the best thing since sliced bread, right? This post is about allowing/enabling Anonymous Access to a site collection – a simple configuration, that “simply works” like once every ten times you try it.

Symptoms

A lot of different ways to hit your head on this one. In any case, your on-premises SharePoint doesn’t allow anonymous access to a site where you are trying to allow it. Most typically, they’ll just encounter 401 error when accessing the site, or they might be missing some of the content or styles, resulting in partially broken site.

Causes

Usually incorrect configuration or non-published resources. Multiple reasons can cause this, though, I’ll describe some of them below with the solutions.

Solutions

A lot of things to check – let’s go through all of the most typical issues here! Continue reading

Using PowerShell to set ULS logging level to “extra verbose” to catch all the events in the logs

Stock photo from pixabay.com

This blog post describes how set the SharePoint’s ULS level to “Extra Verbose” (VerboseEx) using PowerShell. This is not possible using the browser UI, so some POSH magic is required! Luckily, it’s quite straightforward, but to avoid filling your hard drive(s) with huge log files, you should reset the level when you’re done debugging!

Description of the solution

By default, ULS logging is somewhat non-detailed. This means that a lot of data that could be used to debug issues is omitted. The UI cannot be used to set this level of logging to “Extra Verbose” – it is limited to verbose. In case you really, REALLY need to get all the data logged to ULS, you can use PowerShell to enable VerboseEx -level tracing, using the following command: Continue reading

Using PowerShell to modify anonymous access permissions on SharePoint On-Premises

Anonymous access in SharePoint 2013

This post is about managing Anonymous Access on a SharePoint site (SPWeb) using PowerShell commandlets. It’s often a lot more feasible and even easier than using the browser interface! In some cases, it’s borderline impossible to avoid it anyway – since accessing the GUI switch might not be possible.

Description

Assume you have a site collection that’s you have published to the whole world. You’ll have anonymous access enabled at both web application and site collection -levels, and configured permissions at the root web -level. Now, let’s assume you want to disable anonymous access on a certain site deeper in the site structure. This way anonymous users could access your site at http://site.com and http://site.com/subsite, but not at http://site.com/subsite/deepsubsite. As an added bonus, you get security trimming! That means, that the web would even be removed from the navigation for any users, who cannot access it. Especially anonymous users!

Sounds pretty great. How to achieve this, though?

Continue reading

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

Powershell: languagepack 0

Have you ever run into this, very non-descriptive and weird SharePoint error message “Cannot uninstall the LanguagePack 0 because it is not deployed”? You could encounter it while running some PowerShell scripts – most typically, when trying to update a wsp solution.

I have, and luckily often easily solved!

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:

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

I have actually seen this also in the form of “Cannot uninstall Language Pack 0 because it is not deployed”. However, I think the more relevant form of the error is the one that pops up in the PowerShell. See below for an example!

Error "Update-SPSolution : Cannot uninstall the LanguagePack 0 because it is not deployed."

Error “Update-SPSolution : Cannot uninstall the LanguagePack 0 because it is not deployed.”

In Central Admin the solution is in Error state.

151117_ca

Problem

Not really clear, to be honest – most likely, it’s an issue in how SharePoint localizes some of the content types or other declarative artifacts.

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

“Server Error in ‘/’ Application” or “Parser Error” – it’s actually a malformed web.config killing your ASP.NET-application or SharePoint

Malformed web.config causing a Parser Error

This post describes how to resolve a kind of cryptic and oddly misdescriptive error message about Parser Error on your ASP.NET application or (On-Premises) SharePoint site. I ran into this after deploying wsp-packages to a SharePoint farm, but you can apparently get this on ASP.NET MVC sites, too.

Symptoms: Parser Error from a random-looking location

Once you navigate to your web- or SharePoint site, you only get an 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 (the actual source of the error) seem to vary wildly. The exact source depends on what went wrong in the parsing or latest deployments. In any case, they’re usually 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>

Okay, that doesn’t tell us that much! So how to get rid of it?

Continue reading

Visual Studio 2010 fails to show the design view of an aspx-page

SharePoint project properties

This post is about solving the issue with Visual Studio 2010 failing to show the design view of an .aspx-page. Luckily, it’s an easy and pretty classical fix.

Symptoms

While trying to view or edit an aspx-page in design mode in Visual Studio 2010, the window is just plain empty and there’s little you can do about it – selecting view markup or hitting F7 may not do anything and restarting the Visual Studio doesn’t help.

empty aspx page design view

Design view failing to open

Solution

The Design view requires connection to the SharePoint site where you’ll be deploying the solution (or rather, any site). Set the Site URL property in the project settings:

Continue reading

Quickest way to download all the wsp-packages in a SharePoint farm

PowerShell logo

Sometimes – pretty often in the good old on-premises world, actually – you’ll need to have a copy of all the packages that are deployed to a certain farm.

So – how to download all of the deployed farm solutions (essentially, cabinet files renamed to .wsp) from a farm? Luckily, it’s quite easy!

Solution

To download all deployed farm solutions (wsp-packages) from a SharePoint farm is pretty simple using PowerShell. No need to download individual packages through cumbersome interfaces! You don’t even have to open the Central Administration! 🙂  Continue reading

The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

Too long deployment path

This post describes a few different ways of fixing the error “The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.” one can get when trying to package/publish a SharePoint solution, web site or Azure Webjob.

UPDATE 11.4.2016: I actually got this nasty exception on another occasion (Azure webjob publish), so I updated the text accordingly.

Symptoms

Visual Studio throws the following error when packaging a SharePoint solution to a .wsp file, OR when deploying or publishing your web project (for example Azure Webjob).

The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

 

Continue reading