Visual Studio

You are currently browsing the archive for the Visual Studio category.

Earlier this month I’ve had the pleasure of installing a development PC from scratch.

As always, the first question that then comes to mind is: in what order should I install my software?  SQL Server, Visual Studio, any service packs, add-ons, …

Obviously, the basic requirement is SQL Server 2008 R2.  I also need Visual Studio 2008 for custom development, and Visual Studio 2010 for the Database Projects.  Furthermore we’re using Team Foundation Server 2010 for source control purposes.

The list below represents the order with which I’ve come up and which I’ve applied with success.  This order is based on own experience, plus some web research to make sure I didn’t miss anything crucial.

Tip: when given the chance, always go for Custom Install.

  • Visual Studio 2008 (ensure to not install SQL 2005 Express Edition)
  • VS2008 Team Explorer (link)
  • SP1 for VS2008 (link)
  • VS2008 SP1 Forward Compatibility Update for TFS2010 (KB974558)
  • SQL Server 2008 R2
  • SP1 for SQL2008R2 (link)
  • Visual Studio 2010 (ensure to not install SQL 2008 Express Edition)
  • SP1 for VS2010 (link)

In case you’re wondering why this matters so much, well, let’s just say that getting the order wrong can really cost you some time.  In the past I’ve had the pleasure of witnessing an Intellisense (in SSMS) that’s completely broken and an error in VS2010 that prevented me from using the Database Schema Comparison feature to script out the changes.

Hopefully this saves you some time, and I encourage you to have fun while you’re watching that installer’s progress bar!

Valentino.

Share

Tags: ,

Here’s a nice error message for a Friday afternoon:

image

Ouch, catastrophic failure!  Hang on, “catastrophic’”, really??  My computer didn’t explode, I’m still alive, I can even click the OK button to make the catastrophe go away.  Okay, what I was trying to achieve wasn’t possible for some reason, but to call it catastrophic is a little exaggerated.

But I guess it beats the useless “an unexpected error has occurred” message any time.  Because, an error, isn’t that by definition unexpected?  Unless you have an application with a button called Generate Error!

I had the pleasure of encountering this message while attempting to add a new Analysis Services connection to my SSIS project.  For some reason, probably a DLL that didn’t load as usual, not all controls were available and when I specified the server name, I got that message after clicking the OK button.

Here’s another variation, received through another button on that same screen:

image

So now it’s catastrophic and unexpected, sounds more like it! Smile We even got the error number: 0x8000FFFF, well of course!

Most important: I was able to “fix” this issue by restarting my BIDS (2008).

Have fun!

Valentino.

Share

Tags: , ,

Lately I’ve been using Visual Studio Team System 2008 Database Edition with the GDR R2 add-on, also known as “The Data Dude”, to compare databases with each other.

And during a schema compare I noticed that the dude can be quite stubborn now and then.

Here’s an example and an explanation of why, as far as I can tell, the dude is behaving that way.

The Scenario

At work we use the data dude’s schema compare to prepare our deployment scripts.  The most fun can be had when preparing a script to deploy the latest finalized version, version x, from the Development (DEV) to the Acceptance (UAT) environment.

In our DEV database there have already been changes for the next version, version x+1, so these changes need to be skipped.

Now imagine the following situation:

  • a table called TableA exists
  • a new field called NewFieldA was added to TableA
  • a view called ViewA exists and was modified – it uses TableA but not NewFieldA

The changes to ViewA belong with version x, while the changes to TableA are part of version x+1.  So the script that I’m going to generate should contain an ALTER VIEW ViewA … but not an ALTER TABLE TableA ….

The Behavior

Using the dude, I open up the dropdown on the line that states Different definition on TableA and I select Skip.  The value gets changed from Update to Skip.  However, when the focus changes to another line in the grid the value changes back to Update!  Furthermore, it’s now grayed out, impossible to change!

The first time that you see this happening you can’t believe your eyes and try it once more, first closing everything and then re-doing your actions.  Just to see if you didn’t select the wrong option somewhere.  But alas, the dude remains stubborn!

Tip: if you have just executed the compare and you find that some update actions cannot be modified, try to do a refresh (right-click on the background of the comparison window and click Refresh).  I noticed that after the refresh you will get the dropdown for these lines and thus will be able to change the Update Action.

The Explanation

It took me a while to realize, but here’s what seems to be happening.  Like with all things stubborn, it helps if you know what the thing in question is actually being stubborn for.

The dude knows that ViewA depends on TableA and it also knows that both ViewA and TableA where changed.  However, the dude is a little short-sighted, it doesn’t know that NewFieldA is not used in ViewA.  It doesn’t know that the change to ViewA was not related to the change on TableA.  So it automatically assumes that you’re making a mistake and prevents you from messing up.  It thinks, “You stupid user, I know it better, I am smart software!  And that’s not all, I AM THE DATA DUDE! And if there’s one thing you don’t want, that’s to mess with the Data Dude!”.

Here’s a screenshot of the dude’s stubbornness:

Grayed-out Update Action: the result of a stubborn data dude

In this particular case it refused to skip certain new tables, even though there were no dependent objects that needed those tables!  The first two lines show the grayed-out items.  These tables were located under a new schema and I had to put the schema’s Update Action to Skip to get the tables be skipped as well.  The Update Action for the tables was changed automatically when I modified the action for the schema.

But, if you ask me, I don’t see why I shouldn’t be able to Skip a new table even when I am going to create the new schema to which it belongs?  It’s the table that depends on the schema, not the other way around.

The Feature Request

It would have been great if I could manually override the dude’s decision.  As that was not the case, I have to manually change the generated script so that it only contains the changes that I want.  As long as it’s technically feasible, I think manual changes to the Update Action should be allowed.

One More Tip

Take a good look at the following screenshot.

Beware the miniature exclamation mark in the icon's corner!

By default, the node that reads Different dependencies was collapsed.  So you think, good, the line says Skip so nothing will happen.  Except, did you notice that minuscule exclamation mark in the bottom-left corner of the icon?  That means that other actions may be happening further down the dependency tree, as illustrated in the screenshot.

So don’t let the dude mislead you into thinking nothing will happen when it says Skip.  Sometimes the actual actions are hidden further down and you need to open up every node with the exclamation mark on the icon to verify if that’s what you want.

Have fun training the dude,

Valentino.

Share

Tags: , ,

Lately I had been getting annoyed by Visual Studio crashing on me while working on ETL packages.  The crashes seemed somehow related to debugging a package because they usually occurred after I clicked the “Package execution completed. Click here to switch to design mode, or select Stop Debugging from the Debug menu.” link.  But I couldn’t really pinpoint why or when exactly they occurred.  Now I’ve got an explanation, and a solution!

How did I get to the solution?  Well, today I decided to click the “Send to Microsoft” button on the infamous crash pop-up window.  And from it I actually got a link to a fix for the issue.  Apparently the issue is not related to Integration Services in particular, it is a much broader Visual Studio shell issue that occurs in Visual Studio 2008 with SP1 when you’ve got a combination of undocking windows and changing window layout.  And that is indeed what I usually do when debugging a package!  When the package stops executing I often execute the following scenario:

  • double-click the title bar on the Output window to undock it
  • enlarge the undocked Output window to almost full-screen so I can have a good look at the errors
  • double-click the title bar to dock the window back to its original place
  • click the “Package execution completed.” link (or hit the Stop Debugging button)

And that’s exactly the second scenario described in this Microsoft Support article because when you stop debugging, the IDE switches the window layout back from debug to design.

I have now installed the hotfix and the issue is gone.  Beware though if you also use WPF, better read through the whole article and comments on the download page first.

Hmm, this may also explain some other unexplicable crashes I’ve seen lately.  Makes you wonder doesn’t it :-)

Share

Tags: , , , , , , ,

© 2008-2017 BI: Beer Intelligence? All Rights Reserved