My blog has moved!

You should be automatically redirected in 6 seconds. If not, visit
http://www.f5todebug.wordpress.com
and update your bookmarks.

Tuesday, 18 December 2007

VS2005 Unable to Complete Operation

0 comments

This irritating dialog box when trying to debug a project in Visual Studio 2005 is one of those things that you just get used to. When it reared its ugly head this morning I realised that perhaps there were folks out there who were stumped by this.

I am not sure of the reasons for this but in order to debug your application VS creates two files in the bin > debug folder for your project. These will both end with vshost.exe and vshost.exe.config and will be prefixed by your project name. For some reason sometimes these files become corrupt and the VS gives the helpful dialog message above if you attempt to debug.

You need to shut down VS2005 and manually delete these 2 files. They will be recreated as soon as you try to debug again. You have to shut down VS2005 as it retains a file lock on these from when you tried to debug and so you will not be able to delete them unless you shut down the application.

Hope this helps someone out there trying to demystify this ridiculous dialog.

Thursday, 1 November 2007

Ideal Hardware for Running Visual Studio

0 comments

Are you looking for the ideal hardware specification for running on a development machine? I have to be honest that this is really down to the kind of development you are planning on doing with it, but Scott Guthrie over at Microsoft has posted an interesting article on his blog.

I would always have said that the key to a better development box is processor, processor, processor. However Scott proposes a spec which is more reliant on a speedy hard drive. Interested then check out the blog post and see what you think.

He makes a compelling point but its probably one that you need to try out. He also links to some further resources on developer specification hardware which are worth a look.

Friday, 26 October 2007

Deploying VSTO 2005 Customisations in an Enterprise Environment

0 comments

A colleague of mine asked me last week to take a look at some deployment issues with VSTO 2005 customizations. I did do some searching and there is lots of information out there for all kinds of scenarios but there is some misleading stuff too. I thought it may be worthwhile to post some details about the method I used to get this working.

Note: There are many different deployment scenarios that you may come across but this is the way that I dealt with it.

  • Firstly I built a VSTO 2005 customization. This was a simple document action pane which connected to a database and retrieved some details which were used to replace some bookmarks in a word document. However for ease you could just use the following code within the ThisDocument class.

    Public Class ThisDocument

    Private Sub ThisDocument_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup

    MessageBox.Show("This customization has been deployed!", "Success")

    End Sub

    Private Sub ThisDocument_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown

    End Sub

    End Class

  • Once you have built something which works you will need to deploy it. The main consideration in our environment was that the code had to be separate to the document itself, this means that deploying updates is much easier as you only have to redistribute (to the client machines) the document and not the manifests or the compiled code.


  • I established a network share with read access to the Everyone group and Full Control to a specific admin group for this type of work.


  • In Visual Studio 2005, click on Build > Publish <ProjectName>


  • At this point you must select the UNC address to your network share, if you don't use the UNC address then the permissions will be taken from the folder itself not the share.


  • This will deploy the office document and all associated files to the specified share.


  • At this point you could deploy the office document to all your client machines. However if anyone tries to run it they will get a .Net security error. This is because by default remote code execution is NOT allowed in the .Net Framework Configuration.


  • You will need to use the caspol.exe command line application which sits in the c:\<winfolder>\Micrsoft.Net\Framework\<versionnumber>\ folder


  • I used the following to set FullTrust permissions on my network share:

    caspol.exe -machine -addgroup LocalIntranet_Zone -url <yourUNCaddress>\* FullTrust -name "VSTOCustomizations" -description "Code group granting full trust to the code required for VSTO2005 extensions to Office"

  • This should allow your VSTO code to execute from within the local office document.

I hope you find this useful. I have written it rather fast so I may revisit this if it gets a lot of negative comments. I would have found this really useful a couple of days ago.

Thursday, 25 October 2007

For Discussion : Languages

0 comments

Having been a VB developer since I started out on my programming career I am interested in hearing the arguments for and against C#. Speaking as an outsider to C# programming it all seems rather confusing.

When I started out in programming VB was an easier language to learn/guess as it is phonetic, and not case sensitive (which I now see could be a disadvantage in terms of naming conventions etc.).

{ } are a mystery to me (not really, but they do make the code look confusing).

I understand that there are things that can not be achieved in VB that can be achieved in C# or are at least easier to achieve in C#, but I have never come across many.

So I thought I would open this blog post up for some comments on either side as I have recently been considering adopting C#.

Wednesday, 24 October 2007

ASP.Net MVC Framework

0 comments

What?! MVC...???

For those who haven't heard Scott Guthrie (of Microsoft) has announced the launch of the ASP.Net MVC Framework. They are aiming for inclusion in ASP.Net in the early part of 2008.

I had only heard of the MVC model for application development through a course I attended on PHP development last year. Until that time I had never come across the concepts of Model - View - Controller. I am a mainly self taught developer and did not have the 'academic' introduction to development that one might expect from say a degree course or similar (my degree is in electronic media). I do have a PGC in Computer Science, but in the real world this has proved to be of only limited value.

Info: What is the MVC concept (Wikipedia)?

However I am more than willing to give due consideration to anything which can reduce the pain of 'Postback Purgatory'. Anyone who has had to deal with the vagaries of a page which could potentially be posted back with several hundred different permutations has got to be with me on this.

I am still looking into the details of this MVC Framework and will post more on this as details emerge but for now here are the links to the announcement on Scott Guthrie's blog and a video which Scott Hanselman shot at the announcement (Alt.Net Conference).

Info: Scott Guthrie's Blog Announcement
Info: Scott Hanselman's Video

Tuesday, 23 October 2007

Error: The breakpoint will not currently be hit. No symbols have been loaded for this document

0 comments

Came across this little problem today whilst trying to make some amendments to an old project. My first thought was that the projects compile configuration was set to release so the .pdb file (this contains the 'symbols' reffered to in the error message) was not being generated in the 'bin' folder of the project.

After several minutes of searching on Google I found some forum posts over at asp.net/forums and on MSDN which related but the solutions posted did not seem to make sense to me.

Word of Warning - If you are new to .Net development then please do not trust the first solution that you find. A lot of posts on forums etc. contain long winded or misleading solutions. Get a consensus from a couple of sources before attempting to fix the problem.

I sat and thought for several minutes and the best solution to my mind was to first ensure that all reference to the project output were set to Debug.

If you are having this problem then please check the following:
  • Project Properties > Compile > Advanced Compile Options > Generate Debug Info is set to either Full or pdb-only
  • Project Properties > Compile > Configuration set to Debug or Active (Debug)
  • Build > Configuration Manager > Active Solution Configuration set to Debug, and debug is set for all projects displayed here.

After making the above checks then try REBUILDING your project. The pdb file should have now been regenerated. If not then close VS2005 delete all .pdb files for the project (from the bin folder). If you open your solution and try to rebuild again these pdb files should be rebuilt in the bin directory allowing you to debug normally.

Who am I?

0 comments

First of all I would like to say that I do not class myself as an expert in any one aspect of programming. I am currently a developer of software solutions for both the Internet and Windows, using VB.Net and Visual Studio 2008. I am currenlty focussing on SharePoint development.

The purpose of this blog is simple. In recent years when I have come across a problem (however simplistic) I have relied on similar blogs to this one to provide me with the answers. I now feel that it is time I gave something back to the development community, especially to those people who are new to development and cannot find simplistic answers to some of the more mundane problems which they come across.

I also hope to impart some of the methods and techniques which I have adopted over the years which have made sense to me and hopefully made me a more productive developer.

I hope you'll find this blog useful and will come back again and again, but more likely is you'll hit this blog from a Google search looking for an answer to a problem and hopefully...you'll find it.