Showing posts with label visual studio. Show all posts
Showing posts with label visual studio. Show all posts

Monday, August 12, 2013

SP2013 & VS2012: .ascx.g.cs missing!

I've been working with SharePoint 2013 for a while now, on and off...well, mostly off to be honest, as the main client I'm working for - 80% of my time - is still on SP2010 (will be very interesting to get them moved to SP2013!).

The first annoying issue I got was with missing .ascx.g.cs files for the Web Parts. I couldn't actually understand what the hell was happening, for a while! We're using a farm solution (we have full control on the environments) and Visual Studio 2012 to develop.
(...)

Wednesday, April 25, 2012

Visual Studio Tip #2: Run 64-bit version of PowerShell in Post-Build

Whether you are trying to achieve Continuous Integration, Automated Unit Testing or any other scenarios, it might be very beneficial to run PowerShell scripts automatically from Visual Studio after certain actions (such as Deploy or Build).

One problem I had was with the version of PowerShell that would be called from Visual Studio 2010: 32-bit or 64-bit. If you need to use SharePoint DLL's, you need to run the 64-bit version of PowerShell.

It won't work using "%WINDIR%\system32\ WindowsPowerShell \v1.0\powershell.exe", you'll get an error using the 64-bit DLLs, because the PowerShell console that is opened is the 32-bit version.

In order to call the 64-bit version of PowerShell, you must use this path: %WINDIR%\sysNative\WindowsPowerShell\v1.0\powershell.exe.

Tuesday, February 21, 2012

Visual Studio Tip #1: 'View Designer' option disappeared

This happened to me while building a SharePoint workflow.

I created an initiation form with the same name as the workflow, which generates a compilation error: the workflow class will be the same as the code behind in the initiation form. Changing it solves the compilation issue, but you competely lose the ability to view your workflow in Designer mode.

This happens because changes are performed on the .csproj when you add the initiation form, stating the class SubType is ASPXCodeBehing. When you rename the initiation form, new entries are created, but the old one remains as ASPXCodeBehind, instead of returning to the initial value, when you created the workflow.

Re-opening Visual Studio may or may not solve it.

You can go to the .csproj and make sure your class SubType is set to Component, and not Code or ASPXCodeBehind.