You should have encountered the following error "SharePoint is not supported in 32-bit processes" in developing SharePoint with Visual Studio 2012, and how to modify the target platform is not working because the VS 2012 is equipped with a 32-bit IIS Express, The SharePoint program is 64-bit, so there is an incompatibility.
Of course, it can also be done by debugging local IIS without debugging IIS Express, but it's a bit cumbersome. Today, using vs 2013, I found that the new IIS Express 64-bit version of the Web project was added, and I don't know if everyone knows it. If you don't know, listen to me carefully.
1, under Page_Load, simply write the SharePoint server object model, get the site title;
2, browse this Web form in the browser, the following error occurred;
3. Click the VS 2013 tool – option, as shown below:
4. Find the project and solution – Web project, tick the 64-bit version of IIS Express on the website and the project;
5, again in the browser open the Web Form page, found that the normal display of the title of the site;
6, open the VS 2012 This setting, found that there is no IIS Express64 bit version;
Summary
When Visual Studio 2013 adds a new IIS Express 64-bit version, it's a boon for developing SharePoint-based Web projects, and debugging is easier, otherwise debugging is a tangled thing when writing an interface or Web project.