If you have a red cross in your SharePoint project in Visual Studio, you can refer this page: Sharepoint solutions : What visual studio red cross means?
As in the linked page, the problem was that the solution was developed using CKS, and this was not installed on another Visual Studio.
With SharePoint 2013, .NET 4.5 has met the SharePoint world, allowing for example to use the latest versions of the Entity Framework during custom solutions development.
And finally, Visual Studio 2013 will carry MVC development! You can read more info in the blog post Introducing MVC support for apps for SharePoint.
Sometimes, when working with corporate machines, it can happen that you have security issues that make your SharePoint development harder.
One of these problems is that even if you are machine administrator, or you have started Visual Studio as administrator, you still have problems with deploies, or you have DLL locked in the GAC and you are not able to update/delete them.
The solution to this problem is to remove the admin approval from the local policies:
- run the Local Security Policy MMC snap-in (from the start menu, run, type Local);
- go to Security Settings | Local Policies | Security Options
- disable "User Account Control: Run all administrators in Admin Approval"
- reboot the machine
I've seen this trick in the blog post Access Denied trying to uninstall assemblies from GAC.
Microsoft has created a dedicated virtual machine to study the ALM of TFS 2012 and Visual Studio 2012.
The reference article is downloadable from Visual Studio 2012 Application Lifecycle Management Virtual Machine and Hands-on-Labs / Demo Scripts.
How to develop to SharePoint without having SharePoint installed: you need to place the dll both in the hive folder and in the GAC.
This can be useful when it is needed to develop for both SharePoint 2007 and 2010: of course it's not possible to have both of them installed in a developer machine.
This hint has been taken from the blog post How to Perform SharePoint Development On A Client Workstation.
For a recent project I had to install WspBuilder Extensions in Visual Studio 2010 because of a SharePoint 2007 project.
I had some difficulty in remembering that for Visual Studio 2010 you need to install the WSPBuilder Extensions 2010 BETA 1.4.
Finally the best available walkthrough of WspBuilder is in the article WSPBuilder – Walkthrough of the Visual Studio Add-in.
After having described StyleCop in the blog post Using StyleCop to enforce source code standardization, here I describe FxCop.
FxCop is used to do code analysis of generated dlls.
It is automatically integrated in Visual Studio Ultimate edition. In the project properties, it will be possible to find a new "Code Analysis" tab. From this tab, it is possible to enable Code Analysis on build and eventually define a file for custom rules (like for StyleCop, it is a good idea to use a shared file used by all the projects in our solution).
You can find more details in the following articles:
StyleCop is a Visual Studio add-on used to enforce C# source code style rules.
After installation, you can run the checks from the new menu voice Tools | StyleCop; after execution, it will display its alterts as warnings in the Error window.
You can configure the type of warnings to be signaled with the online editor, that modifies the Settings.StyleCop file (simply double click on the file on your file system to edit it).
It's enough to have the Settings.StyleCop file (or better: a link, so that all projects reference a common file) in your Visual Studio project, so that after each build these additional checks are done. And StyleCop can work as a custom MSBuild task too.
You can find more informations in the blog post Enforcing coding standards with Microsoft StyleCop.
What to do when creating a new wsp in a Visual Studio 2010 SharePoint 2010 solution
- delete the created snk and add a reference to your global snk file (add existing item, Add As Link)
- from project properties, sign the assembly using the previously referenced strong name key file
- from project properties, choose the deployment configuration between Default and No Activation
- from project properties, disable the Auto-retract after deploying flag
- if not done during creation time, from the project properties set the site url
- add the needed references to the other assemblies in the solution
- unload the project file and add the tag needed to create the wsp file automatically, as described in my post Visual Studio 2010: how automatically build wsp packages after SharePoint 2010 build
- from package, advanced, add the assemblies you want to include in the wsp and deploy in GAC
- write one or more web-application scoped features, used to activate and deactivate the other features at site collection (SPSite) or site (SPWeb) scope
- if the wsp has not web-application scoped items, create an empy WebPart and a site collection scoped feature to be able to deploy the wsp to a single web-application, as described in my post SharePoint: how make your wsp deployable in a single web application
If you have ever developed SharePoint packages (wsp) with Visual Studio 2010, for sure you have feld a less than ideal user experience, because Visual Studio is not so integrated as WSPBuilder was with SharePoint 2007.
You can get a few of the better features of WSPBuilder installing the following add-on for Visual Studio: CKS: Development Tools Edition.
In particular, the commands I find more useful are:
- Copy to SharePoint Root
- Copy to GAC/BIN
- Recycle All SharePoint Application Pools
- Restart IIS
- Restart OWS Timer Process
- Attach to All SharePoint Processes
- Attach to IIS Worker Processes
- Attach to OWS Timer Process