Pages

Friday 18 December 2015

Failed to remove SharePoint Hosted App



We were facing this problem, found on some blog's that is a MS bug.
I know touching SQL DB not recommended.  But found  to get away with this.

"The provided App differs from another App with the same version and product ID"
Ever since the beginning of 2013, we have this this problem when you deploy and redeploy App (now SharePoint Add-in) to either SharePoint 2013 on-premises or Office 365's SharePoint Online.

If you Bingle about - you will find various fixes, in order of severity:

1 - you can try to retry Installing the App, or removing it from Site Content http://www.mavention.nl/blog/provided-App-differs-another-App-same-version-product-ID
2 - try removing it from Site and Site Collection recycle bins.  Also remember the second level recycle bin.  This one is usually good enough for Office 365.
4 - You can also just increment the version number.  This is difficult when you work in a team and you don't want to bump _everyone_'s number
5 - Delete the offending Site Collection and create a new one

I found a new, TOTALLY UNSUPPORTED WAY.

Sometimes, you really just want to delete the old one.  But the Object Model doesn't have objects that go that deep.  Hence there are no way to do this via command-line either.
You need AppInstance to perform an uninstall.  If you can't get an AppInstance, but the AppPackage is still in your Site Collection, you are pretty much stuck.
Let's go check out the content database.  Disclaimer: Do this if you are curious.  Also, don't do this on your production.
SELECT [PackageFingerprint]
      ,[ProductId]
      ,[Package]
      ,[Title]
      ,[IsDownloadInvalidated]
      ,[SiteId]
  FROM [WSS_CONTENT_DB].[dbo].[AppPackages]
You want to know which Site Collection it is.  So figure out which AppPackage is the one SharePoint can't delete - by cross-checking the SiteId
PackageFingerprint is an important field that we'll need in a minute.  It acts like a unique identifier.
IsDownloadInvalidated is probably 0 (meaning it is valid).  You just can't delete it.
SharePoint has a few nice store procedures.
exec [WSS_CONTENT_DB].[dbo].proc_App_InvalidatePackage
    @PackageFingerprint, @SiteId

-- example
exec [WSS_CONTENT_DB].[dbo].proc_App_InvalidatePackage
    0x9DB9C067E1B970AD1258E28AE26EC3AE17CF772BC093D0CCF8E1832FF3B171261A09812778830621AA63FD4C9D1EA922DC5432E1CACDEA00B1CDA82F9A28CAE2, 
    '282292D5-3686-460D-9AB4-9354272FB2A1'
This stored procedure will flag the AppPackage as Invalid.  If you do SELECT * FROM AppPackages again, you'll see it is now IsDownloadInvalidated = 1
So SharePoint now thinks there was something wrong with the download of this package :-)Let's invoke SharePoint's auto-immune system and nuke the AppPackage
exec [WSS_CONTENT_DB].[dbo].proc_App_DeleteInvalidatedDownloadApp
    @PackageFingerprint, @SiteId

-- same arguments.  
This one will nuke the AppPackage clean.
You can now go back to PowerShell and redeploy your App.
PS> $App = Import-SPAppPackage -Path  -Site  -Source 
PS> Install-SPApp -Web  -Identity $App 
This works really well.  But you REALLY shouldn't touch the Content DB

Thursday 16 April 2015

Responsive web design is working on desktop but not on mobile device


Question:

We have a SharePoint site which was responsive for mobile devices, but due to some reason
it was showing proper desktop view , and when we squeeze browser to see responsive behaviour
then also UI was giving responsive behaviour.
but same site was not showing responsive behaviour on mobile devices.


Resolution:
we were missing a meta tag:



It worked perfectly after adding the tag.

Friday 13 February 2015

Installing SharePoint 2013 on Windows 8


Installing SharePoint 2013 preview on Windows 8 is unsupported,  You need to install on either Server 2008 R2 SP1 or Server 2012 RC. With Hyper-V support in Windows 8, why would you need to? Just virtualise the environment.

UPDATE: This installer will only work on Win8+ don't try it on Win7.
If you want it "close to the metal" without installing a server OS now you can, you decide for yourself if it is a good idea ;-)
It is COMPLETELY unsupported by MS and should only be used for a local development/demo machine.
 
​First you should download SharePoint foundation 2013 with SP1​ or SharePoint Server 2013 with SP1.
If you need to apply a language pack you get them from here.
This setup requires you to be joined to a domain. If you want to use local accounts it can be done but it won't be described here.
It would be great though if you help others by posting on how to do this here.
0) First make sure you have installed IIS on your machine. It isn't installed by default.
I'm installing pretty much everything except "good old" ASP.
iis.png
Then make sure you have HTTP Activation AND TCP Activation installed (.NET Framework 4.5 Advanced Services/WCF Services).

HTTPandTCPactivation.png
WIF.png 
If you are on Windows 8(1), make sure you have WIF installed. The standalone installer won't run on Win8 you install WIF
from "Turn Windows features on or off".
Make sure that the Net. Tcp Listener Adapter service and Net. Tcp Port Sharing Service are both configured to start automatically.
services.png 

1) Download the installer zip file from here.
2) Unzip the installer to your desktop.
installer.png
 
3) Launch setup.exe.
trust.png
 
This will install the "launcher" into your​ directory of choice.
location.png
 
4) Browse to the location where you just installed the software and start Launcher.exe
launcher.png
 
5) When you start Launcher it will open a "OpenFile" dialog where you will pick the app to start. We first pick prerequisiteinstaller.exe to get all the prerequisites installed.
(Try pick another locked down installer)
prereq.png
6) Run through the prereq wizard and if you get a problem installing some of the components try to reboot. There's also a step when the
wizard will reboot the machine. Remember that when the machine has rebooted the wizard will automatically be launched by windows and
you will see an error message saying "this OS is not supported". Don't worry just close the wizard and relaunching using Launcher.exe as described above.
prereq1.png
 
Once​ the wizard is complete you go to the next step and install SharePoint.
complete.png
 
7) Restart Launcher.exe and pick setup.exe
setup.png

 
8) Follow the setup wizard :-)
​​​​productKey2.png

endSetup.png 
9) Click close to run the configuration wizard.
cw1.png

 
10) The next screen warns us that we are installing on Vista or Windows 7, don't worry the same applies to Windows 8/8.1 UNSUPPORTED in every way ;-)
vista.png
 

11) Create a new Farm, wait and take a snack :-)
farm.png
 
time.png
 
happy.png
 
12) We are finally done running a "private cloud" ;-)

pc.png
 
Source:http://www.disruptivei.com/Blogg/Inl%C3%A4gg/6/Install-SharePoint-2013-on-Windows-7-8-8-1