CSC : error CS1548: Cryptographic failure while signing assembly xxx.dll Error signing assembly — Access is denied
Yesterday I got this error while building my application after installing Windows 7 x64. I thouoght it was because of X64 OS, but later I found it doesn’t have anything to do with X64 OS. I don’t know the actual problem or solution.You can fix this error by setting permissions.Browse to the following folder ‘C:\Users\All Users\Microsoft\Crypto\RSA’ and modify the security settings of the ‘MachineKeys‘ folder such that Everyone have read/write access to it and the Administrators have full control. Don’t worry if you couldn’t find “All Users” folder in the path, just put that path into Run and it will open the Path(Actually it is opening the same folder from ProgramData). Again I don’t know this is an actual fix or not, but it works
How to execute a macro after Build is completed
Recently I started using VS Professional edition, which doesn’t have an inbuilt Source code analysis option. And I have to run the Source code analysis after each build. And today I found a solution for the same using environmental macros.
Open the Macros IDE, from Tools > Macros > Macros IDE. This will launch Visual Studio macro editor.
Double click on the MyMacros project, from the Project explorer.
Open the EnvironmentEvents class. This class contains various system generated code, add the following code in below the region.
Private Sub BuildEvents_OnBuildDone(ByVal Scope As EnvDTE.vsBuildScope, _
ByVal Action As EnvDTE.vsBuildAction) _
Handles BuildEvents.OnBuildDone
If Action = vsBuildAction.vsBuildActionClean Then
Exit Sub
End If
If MsgBox("Run Source Code Analysis?", _
MsgBoxStyle.YesNo + MsgBoxStyle.Question, "FxCop - Confirm") = _
MsgBoxResult.Yes Then
DTE.ExecuteCommand("Tools.ExternalCommand6")
End If
End Sub
This method will be executed once the Build is finished. As I integrated FxCop with my Visual Studio as my external tools, it will execute the External Command 6. It will display a confirmation message, after completing the Build, and if yes press, it will execute the FxCop.
Happy Coding
How to do Rollback of a change set in TFS 2010
TFS 2010 provides you the ability to Rollback or Undo a ChangeSet from TFS 2010 itself. You can also see it as a new pending change type as Rollback (new change type in the history) inside Team Explorer.
You can more information in MSDN : Rollback Command (Team Foundation Version Control)
If you want to rollback you change 123, you need to do some thing like
cd c:\Code\you must useProjectName tf rollback /changeset:123
Debugger Canvas
Debugger Canvas is an excellent debugging tool which will be introduced into Visual Studio by early next month. From Offical description – Debugger Canvas pulls together the code you’re exploring onto a single pan-and-zoom display. As you hit breakpoints or step into code, Debugger Canvas shows just the methods that you’re debugging, with call lines and local variables, to help you see the bigger picture. It will require Visual Studio 2010 Ultimate SP1 (or the trial version).
You can get more information about Debugger Canvas from here and here also.
Here is a demo video about Debugger canvas.
Changing the diff program used by Visual Studio
You can configure your own diff program, instead of the default diff program provided from Microsoft for comparing two files. In this post I am using Beyond Compare.
- Open Visual Studio 2010
- Select Tools > Options menu.
- Select the Source control Tab in the left side.
- Click the “Configure User Tools” button in the right pane. It will popup a Configure user tools dialog like this.
- Now you are ready to enter the configuration for whichever tool you choose to use. Below is the settings for Beyond Compare.
- Here is the settings.
Extension: .*
Operation: Compare
Command: C:\Program Files\Beyond Compare 3\BC2.exe [replace with the proper path for your machine]
Arguments: %1 %2 /lefttitle=%6 /righttitle=%7
Happy programming
Here is a detailed post regarding diff/merge configuration in Team Foundation – common Command and Argument values from James Manning.


