Error in Visual studio:“Metadata file ‘abc’ could not be found”

I encountered a strange bug today while coding in Visual Studio.

Metadata file ‘abc’ could not be found

 

Now this could happen if one project in the solution was not compiling, but every project in the solution compiled without error. The natural next step is to do a Clean / Rebuild which I performed, but the error persisted. I went through the properties for a recent project I added to the solution and that was fine as well.

Eventually I found a solution online:

  • Manually clean each project separately
  • Manually rebuild each project separately.

Why should it matter if you do a global clean and rebuild or a manual rebuild of each project I don’t understand but it is how I fixed the problem.

 

How can I get the schema.xml file for a list in SharePoint

 

There is a quick and dirty way to download the schema.xml file from a SharePoint list.

Just point your browser to the Url below. (Obviously change the relevant parts):

http://YOUR_SERVER_URL/PATH_TO_SITE_CONTAINING_LIST/_vti_bin/owssvr.dll?Cmd=ExportList&List={YOUR_LIST_GUID}

 

A cleaner way to go about it is to export the site as a template, download the created WSP and open it in Visual Studio.

An even easier way is to download SharePoint Manager (make sure you get the right edition of SharePoint Manager for the version of SharePoint you are using). It will let you see the schema as well.

Exporting a SharePoint list using PowerShell

There are some great 3rd party tool that make copying and moving lists between different SharePoint farms easy and a few clicks.

If you are not lucky enough to have access to such a tool the easiest way is to export the list to Excel using built in SharePoint functionality.

This requires Excel to be installed on the computer you are using to export the data.

Recently I found myself in an environment that did not have access to 3rd party tools, nor Excel. What to do?

Thankfully PowerShell makes it easy

We start off with the most basic example:

Export-SPWeb http://site -Path “site export.cmp”

 

Here is one with a few more options used:

Export-SPWeb -Identity “http://localhost” -ItemUrl “/site/lists/ListTitle” -path “c:\exportfile.exp”

Note the file extension is not required, and can be anything.

Important parameters. (you can find a full list here)

  • Identity: full url (absolute) of the site where the list exists
  • ItemUrl:  relative path of the list
  • path: path of the output file to save the data in.

 

If you have many items in your list, you might see that PowerShell generates many files. This is normal

The content of the list is in a binary format so its not much to look at.

Once you have exported your nice list, you might want to Import it.

For that job there is:

Import-SPWeb http://site -Path export.cmp -UpdateVersions Overwrite

WorkflowHistory list on a localized farm.

 

This is a short note.

If you are working on a SharePoint farm that has been localized, Urls that you are used to pulling up might not be where you expect them to be.

For instance, the Workflow History list lives at:

http://localhost/Lists/Arbeidsflytlogg/

In a SharePoint farm localized for Norwegian.

If you find yourself in on a localized box and you do not quite know what things are called, taking a look at all the lists can be helpful.

 

 

 

Error when using PowerShell to uninstall a wsp in SharePoint 2010

When using PowerShell to uninstall a solution / wsp under Sharepoint 2010 I got the following error:

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

That is a puzzling error message. I have no idea what language pack they are referring to, nor why it is relevant right now.

Here are some ways to troubleshoot this error:

If you are using a script to uninstall and reinstall a wsp, the reason for the problem may be that that Uninstall has already run successfully.

 

And you are running it again, after it has succeeded. In at least one case, this was the case for me. In this case, just login to central admin and go to:

Central Administration >System Settings > Manage farm solutions

Look for the entry for your wsp and check what its status is.

In some cases, it may be necessary to run services.msc and restart SharePoint Timer service and the SharePoint Administration service.

This should get you back on track again.

Using Powershell to retract, uninstall, deploy and install a wsp file.

Usually I have been using stsadm when I wish to install wsp files / solutions on a SharePoint farm.

Since I switch back between SharePoint 2010 and SharePoint 2013 environments often, having to remember two different ways of doing the same thing is annoying. You can however use Powershell to accomplish this in 2010 as well:

 

 

Sometimes you deploy a package that is not scoped for a specific web application, if that is the case omit the web application parameter:

 

 

 

Update-SPSolution –Identity MySuper.wsp –LiteralPath c:fullpathtoMySuper.wsp –GACDeployment

 

Update the Site Url for a SharePoint development project

 

If you open up a SharePoint development project in Visual Studio and attempt to build it you may get an error message such as:

 

Error occurred in deployment step ‘Recycle IIS Application Pool': Cannot connect to the SharePoint site. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project.

 

That seems clear. I open up the Properties window from the Project Window:

 

Even if you page trough every tab the value is not there. Suddenly it does not seem quite so obvious.

The confusion here is that you want the Properties Windows and not the property page.

 

The property Window can be found under the View menu item:

 

And this is where the Site Url property lives

What happens to versioned data if you delete a column from a content type

Let us say you have an existing SharePoint environment with lots of document libraries and a few content types. For some strange reason you have to delete site column.

In order to do this you must first remove the site column from every content type it belongs to.

Before you do this, you might be worried about what will happen to the meta data changes logged in the versioning for each document.

The good news is that you can delete the columns without any fear of losing the versioning data. It remains the same. As you would expect.

As an aside, it is a better idea to hide the column you do not wish to use anymore, but due to special circumstances with a client, I had to remove the column completely.

An update on my Blackphone

Well I have had a lot of problems with the Blackphone now.

Activate your apps when you install

When you are going through the installation sequence, have the little paper with a QR code handy.

The way the UI is designed its very easy to skip this step. Once you have given the phone a working wifi connection (or possibly cellular data), hold your paws for a while and the QR reader will come up. If you click Next in the hope it will appear you will skip over it, and you will not be able to press “back”.

Furthermore you will never be able to run the QR Activation reader if you are not in initial install mode.

So I skipped it the first time around, and the steps you have to go through to do it manually are quite labor intensive, so I decided to do a factory reset, and carefully scan my QR code at the right time. If you do this right, your life will be easier. The QR reader works well, and all your apps are initialized with your extra services.

If you have a really secure password for Spider Oak it will take time to thumb it in.

This is not a specific critique of the Blackphone but rather a great frustration with the login feature.

I have setup a long, once and secure password for Spider Oak, and usually I have no problem with it. But when it comes to fat fingering it in on a small phone keypad, and the option to “display password” is not available you are essentially typing blind and crossing your fingers that you will get every character right.

This leads to ideas of having a shorter, and easier to type password, in order to make it easier to thumb in, but that has consequences as well.

Enabling “display password” would be a small help in figuring out if you fat fingered it correctly.

As I explain below i have gone though several factory resets, and each time Ive had thumb that password in.

I cannot get Silent Phone to work, period.

After my factory reset to get my QR code scanned, I have been completely unable to get Silent Phone working.

I get the following error:


phoneError.jpg

I have no idea what tivi_cfg.xml is. Apparently its a snibbit of json that for some reason cannot be found.

I have reset my phone, rebooted, and tried a few other things and this message persist.

It happened July 3rd, and its July 9th at the time I write this and its still not working.

I have been in contact with support and so far they have not been able to identify the problem.

They had me go through an even more thorough factory reset, but that did not help either.

By now I am frustrated.

SharePoint designer problems with Office365 (SharePoint Online)

SharePoint designer 2013 a very annoying issue. When you are using SharePoint designer with SharePoint online, you will probably experience that you are unable to open a workflow in the designer. (Edit workflow).

You will get message similar to this:

Generating local caches , downloading meta data

Followed by this uninformative message

Server side activites have been updated. You need to restart SharePoint designer to use the updated version of activies.

Now sometimes this is right, you just need to restart SharePoint designer. So then it works.

For me most of the time restarting does not work. Neither does rebooting.

What is going on, behind the scenes is that Microsoft is constantly updating SharePoint Online. This is for the most part a good thing. However in this instance SharePoint designer needs to be updated to the latest SP or KB for it to be able to correctly synchronize with SharePoint Online.

This is another instance where they need to update the message that you receive. Something like: Sharepoint Designer cannot sync with the current version of SharePoint online, please update SharePoint designer with the following KB or SP)

So in short if you get this error, download updates, install them, maybe reboot, and SharePoint designer should again allow you to update the workflow.