If you were trying to find how to create a windows gadgets project in visual studio you have come to the right place.
Well its much simpler than you thought.
1. Create a CAB Project. Select File -> New -> Project, and pick CAB Project in Other Project Types
-> Setup and Deployment -> Visual Studio Installer
Type the Project Name you want, in my scenario I have given MyNewCabProject and Press OK
2. Select the project name in the Solution Explorer and select the PostBuildEvent
3. Copy these lines into the Post-Build Even Command Line, replacing MyNewGadgetName with the name of your gadget.
set GadgetName="$(ProjectDir)$(Configuration)\MyNewGadgetName.gadget"
copy /y "$(BuiltOuputPath)" %GadgetName%
%GadgetName%
Now, when the project builds, it creates the .CAB file, copies it to a .gadget file and then runs the gadget to install it.
Thursday, 18 August 2011
Wednesday, 17 August 2011
Could not load type ‘Microsoft.AnalysisServices.SharePoint.Integration.ReportGalleryView’
A number of people have hit this issue and so it deserves a quick walkthrough of why it (unfortunately) can happen and how you fix it.
The error occurs when you try to select a Document Library of type PowerPivot Gallery (sometimes referred to as Report Gallery). After installing Power Pivot for SharePoint, all new site collections you create have the option to create a new document library of this type and if you use the PowerPivot Site template when creating the site collection, it automatically adds a library of this type (that is the main thing we do in this template). The ability to add this type of library in all new site collections is there because we defined the library in a feature which is subsequently stapled to all sites. This means it is automatically activated on all site collections. The problem is that the page which is loaded when you click on the library as its default view uses an ASP.Net control whose code behind is found in a dll which is not being found.
So when does this happen? Every case I have seen so far, this occurs when the user creates a new Web Application and does not deploy the WebApp solution to the new Web Application. Because of how MS reference the classes for our pages, we need to have the associated assembly in the <vdir>\bin directory.
This assembly is Microsoft.AnalysisServices.SharePoint.Integration.dll. The dll is “pushed” to the web applications on every WFE in the farm via the SharePoint solution infrastructure.
Ignoring any of the questions around “how should we have done this to avoid this error” .. to fix this situation, you simply need to deploy the web app solution to the Web Application you just created. To do this, go first to the System Settings page in Central Admin
Under Farm Management, select Manage farm solutions.
Click on the powerpivotwebapp.wsp solution to see its properties
On the properties page, you will see the “Deployed To” list and notice that your new web application is not on this list. Select the “Deploy Solution” link at the top of this page
You can now chose to deploy the solution to the new Web Application you have created (and you can chose to do it “Now”). After this, the bits will be pushed to all machines in the farm and you can use the PowerPivot Gallery in your new site collections. One thing to note (since I got burned by this) … instinct is, after this is done, to just go back to the error page and hit refresh thinking that it should be fixed now. The error page, though, is an actual error page and when you hit refresh, all you are doing is reloading the error page. To actually reload the PowerPivot Gallery, use the back button in your browser or click on the “Go back to site” link in the error page.
The error occurs when you try to select a Document Library of type PowerPivot Gallery (sometimes referred to as Report Gallery). After installing Power Pivot for SharePoint, all new site collections you create have the option to create a new document library of this type and if you use the PowerPivot Site template when creating the site collection, it automatically adds a library of this type (that is the main thing we do in this template). The ability to add this type of library in all new site collections is there because we defined the library in a feature which is subsequently stapled to all sites. This means it is automatically activated on all site collections. The problem is that the page which is loaded when you click on the library as its default view uses an ASP.Net control whose code behind is found in a dll which is not being found.
So when does this happen? Every case I have seen so far, this occurs when the user creates a new Web Application and does not deploy the WebApp solution to the new Web Application. Because of how MS reference the classes for our pages, we need to have the associated assembly in the <vdir>\bin directory.
This assembly is Microsoft.AnalysisServices.SharePoint.Integration.dll. The dll is “pushed” to the web applications on every WFE in the farm via the SharePoint solution infrastructure.
Ignoring any of the questions around “how should we have done this to avoid this error” .. to fix this situation, you simply need to deploy the web app solution to the Web Application you just created. To do this, go first to the System Settings page in Central Admin
Under Farm Management, select Manage farm solutions.
Click on the powerpivotwebapp.wsp solution to see its properties
On the properties page, you will see the “Deployed To” list and notice that your new web application is not on this list. Select the “Deploy Solution” link at the top of this page
You can now chose to deploy the solution to the new Web Application you have created (and you can chose to do it “Now”). After this, the bits will be pushed to all machines in the farm and you can use the PowerPivot Gallery in your new site collections. One thing to note (since I got burned by this) … instinct is, after this is done, to just go back to the error page and hit refresh thinking that it should be fixed now. The error page, though, is an actual error page and when you hit refresh, all you are doing is reloading the error page. To actually reload the PowerPivot Gallery, use the back button in your browser or click on the “Go back to site” link in the error page.
Monday, 15 August 2011
CSharp.Net SharePoint List of Document Libraries using Client Context
This code will only return Document Libraries which are based on Template 101 ancestral type.
ClientContext clientContext = new ClientContext("http://mysharepoint");
Web oWebsite = clientContext.Web;
ListCollection collList = oWebsite.Lists;
clientContext.Load(collList);
clientContext.ExecuteQuery();
foreach (List oList in collList)
{
if ((oList.BaseType == BaseType.DocumentLibrary) && (oList.BaseTemplate == 101))
{
Do your actions here with oList.Title, oList.Title
}
}
Friday, 5 August 2011
Get a list of all Triggers in a SQL Database
SELECT S2.[name] TableName, S1.[name] TriggerName, CASE WHEN S1.deltrig > 0 THEN 'Delete' WHEN S1.instrig > 0 THEN 'Insert' WHEN S1.updtrig > 0 THEN 'Update' END 'TriggerType' FROM sysobjects S1 JOIN sysobjects S2 ON S1.parent_obj = S2.[id] WHERE S1.xtype='TR'
The above doesn't correctly identify INS, UPD and DEL. Try:
SELECT S2.[name] TableName, S1.[name] TriggerName, CASE WHEN S2.deltrig = s1.id THEN 'Delete' WHEN S2.instrig = s1.id THEN 'Insert' WHEN S2.updtrig = s1.id THEN 'Update' END 'TriggerType' , 'S1',s1.*,'S2',s2.* FROM sysobjects S1 JOIN sysobjects S2 ON S1.parent_obj = S2.[id] WHERE S1.xtype='TR'
The above doesn't correctly identify INS, UPD and DEL. Try:
SELECT S2.[name] TableName, S1.[name] TriggerName, CASE WHEN S2.deltrig = s1.id THEN 'Delete' WHEN S2.instrig = s1.id THEN 'Insert' WHEN S2.updtrig = s1.id THEN 'Update' END 'TriggerType' , 'S1',s1.*,'S2',s2.* FROM sysobjects S1 JOIN sysobjects S2 ON S1.parent_obj = S2.[id] WHERE S1.xtype='TR'
Subscribe to:
Posts (Atom)