Installing .NET Framework 3.5 on Windows 8.1

God, why is this so difficult? I needed to install the .NET framework 3.5 (for SQL Management Studio, dammit!) on my Windows 8.1 machine. You’re supposed to be able to do this from control panel (Programs and Feature > Turn on Windows Features > .Net 3.5). It didn’t work for me. Continue reading “Installing .NET Framework 3.5 on Windows 8.1”

Advertisement
Installing .NET Framework 3.5 on Windows 8.1

File Path Lengths in Windows

In the Windows API the maximum length for a path is 260 characters.

Slightly edited for length, but that comes from MSDN. Yes, it’s 2014, we’ve dealt with the 8.3 filename limit, found the Higgs Boson, landed a fridge on a comet, but the Windows API still doesn’t play well 260 character length file paths. That’s unfortunate. Continue reading “File Path Lengths in Windows”

File Path Lengths in Windows

SharePoint vs (?) ASP.NET MVC

I’ve been studying ASP.NET MVC 4 over the last while; this is the subject of second of the 4 exams required for the SharePoint Developer MCSD, and I really need to spend some time on that.

The idea of an MVC (Model-View-Controller) framework is to separate the different concerns of your code, and that usually this allows you to design a data model, and then let your tools create a scaffolding of your site. Such things aren’t new; I implemented a Chinese Chess web site in Ruby on Rails which uses this approach in 2005. I loved the MVC approach. Continue reading “SharePoint vs (?) ASP.NET MVC”

SharePoint vs (?) ASP.NET MVC

Clearing the CA0068 Error in Code Analysis

This error was appearing in the code analysis for one of my SharePoint projects. It reads:

Warning 1 CA0068 : Debug information could not be found for target assembly ‘Something.exe’. For best analysis results, include the .pdb file with debug information for ‘Something.exe’ in the same directory as the target assembly.

Annoyingly, it didn’t seem to allow you to suppress it, and I was doing a Release build – so I didn’t expect to have a .pdb file. Continue reading “Clearing the CA0068 Error in Code Analysis”

Clearing the CA0068 Error in Code Analysis

Attaching Visual Studio 2010 to Outlook 2010 plugin for Debugging

I was trying to attach a debugger to an Outlook plugin I was working on. It was originally written for Outlook 2003, but has been progressively upgraded to 2010. However, I couldn’t breakpoint my code, or rather, the breakpoints weren’t being hit.

Found the answer on Stack Overflow:

So it turns out that Outlook doesn’t load the CLR on startup (it must be loaded shortly thereafter when it becomes necessary), which apparently confuses the VS debugger and causes it to only debug native code. To force it to load the CLR immediately, create an OUTLOOK.EXE.config file in the same folder with:

<configuration> <startup> <supportedRuntime version="v2.0.50727"/> </startup></configuration>

which is from this blog post. Then, even when VS starts attached, it will debug CLR code

Attaching Visual Studio 2010 to Outlook 2010 plugin for Debugging

Editing a XAML build process

So, we’ve been working on putting our SharePoint solutions through a proper build process in Team Foundation Server 2010 (TFS), and I hit a bit of a snag.

I had been given a build definition that had a build process – a Workflow Foundation workflow – that I wanted to alter. The problem was that while I had the XAML file for that workflow, and the DLL that defined some custom code activities that the process used, I didn’t have a full Visual Studio project for it. No problem, I thought, I’ll just open the XAML up in Visual Studio and edit it.

Wrong.

Continue reading “Editing a XAML build process”

Editing a XAML build process

Further notes on SmartAssembly Obfuscation

Some further notes on things I’ve learnt using SmartAssembly on some of our products.

  • Constants do not get obfuscated. Use static readonly variables in their place if the constant contains sensitive information.
  • Run Reflector (or reflection tool of your choice) against your assembly after obfuscation, to check what is visible. Then go back and make the bits you accidentally left public internal or private.
  • Make as many classes and methods as you can Internal
  • Do read the instructions on the attributes you can apply to control obfuscation.
  • Do use Pruning if you want to remove parameter names for methods. That can leak a lot of information about what a class is doing.

 

 

Further notes on SmartAssembly Obfuscation

Obfuscation, Code Analysis, and Check-In policies

As mentioned before, we’ve started to use SmartAssembly to obfuscate some of our products. We also use Team Foundation Server (TFS) as source control and build server. Using obfuscation with code analysis caused some issues, which were compounded by our check-in policies. Continue reading “Obfuscation, Code Analysis, and Check-In policies”

Obfuscation, Code Analysis, and Check-In policies