Category Archives: Visual Studio

Embrace AND! in your way of living.

A good acronym might be..  Abundant  natural  decisions

Activity N___ 🙂  determination.
But I was mainly saying, try to do a little bit of both things you enjoy.

Advertisements

Instructions for Setting up Entity Framework 6 and Data Test Project‏

I had gone through a lot of days of futzing to make this work and thought others may benefit from this as well. Instructions are included for both VS2010 (at the very end) and VS2015.

VS2015

VS2015 is much easier than VS2010, as both the Entity Model and the DBContext generator (pick either version 5 or 6, depending on your needs), as they are right in Add New Item’s dialog box under “Data” subsection.

Project settings modifications

Your DAL project will need to have the app.config set to Your unit test project then needs 2 things:

Adding a Reference to EntityFramework.dll in the Data Test project, to match the same EF reference item from your Data project.

And a post build step to bring in the config, otherwise your EF Integration tests will fail saying it can’t find the connection. Exact command that I’d used is not a perfect outcome compared to a file move, as this does a copy:

copy App.Config $(TargetName).config.

 post20build20step_zpsrrirz1ju

VS2010

If in VS2010, first add a ADO.NET Entity Data Model.
Then search for “Entity” and add the Nuget Package for EntityFramework 6.x.  Note, you won’t be able to use the designer though, so I’d highly recommend getting VS2012 or higher.

 Enjoy, and happy DAL coding!

Debugging multithreaded or recursive operations

Hi all.  I hope everyone is making their day great. I had a scenario where the Watch value of an expression was valuable to see during the recursion of a function. I had a recursive SolveSolution function and it worked with continuously getting the next empty cell and plugging in a trial value in that to see if it was a legal move.

The Parallel Watch window is a great tool in this manner. You can add several watches and they each go in as a column value.  Here’s a screenshot to follow along into the recursive method. Take note of the Recursion Depth value as well.Parallel Watch window

Using the output of this tool, the application bug that I’d remaining was a lot easier to resolve and resulted in a quicker resolution. Hope this helps!

References

MSDN – How to: Use the Parallel Watch Window
MSDN – Walkthrough: Debugging a Parallel Application
http://www.dotnetcurry.com/visualstudio/994/debugging-parallel-code-visual-studio

Learning more of Git source control, coming from TFS background

Learning more of git these days, as I’m helping with a side volunteer project online – Red Cross crisischeckin (for disaster relief and the management of helpers and other resources for each disaster. Also has cool features to message people on their phones too). Feel free to help out if you’d like by forking the repo and checking for open issues.

Anyways, what are my findings thus far and what is Git? It’s a distributed version control system. What does that mean in simple terms? It has the capability to be on multiple peoples’ machines, and potentially on a server (in the case of http://github.com or http://bitbucket.com). Git source control and all history lives locally, so commits and diffs are much faster than TFS as well (not saying that I favor Git over TFS, at least in the business realm, I’d still prefer TFS myself).

Well, lots of commands and advanced features as compared to TFS. Some of the ones so far I’ve used as a beginner to Git are:
git branch BranchName (makes a branch)
git branch -l (lists branches)
git checkout BranchName (switches to another branch)
git add FileName or Pattern or “.” for all files (includes/stages a file in the current branch, does not commit)
git commit -m ” (commits your changes with the message after -m switch. If you add in a -a, the commit will include modified/deleted files that previously existed, even if you didn’t “git add” them prior. Saves you a step if not using an IDE)

git remote (adds/configures remote repositories)
git remote -v (lists repos)

git stash (like a TFS Shelve, where you’re saving off the changes but not committing them for others to see directly in the history)

Two of three ways that you can launch help:
git CommandName –help   (saves a bit on typing if the command is in your history)
git help CommandName

I can appreciate Git for its speed and leanness, and beyond that there is plenty of options for branching and merging, more-so than TFS. I do like using the Visual Studio Team Explorer pane for the majority of the changes and then when needing more involved commands, going to thee Git Bash command window and executing them there.

The rebase, revert, and reset operations are ones I’m planning on looking at next time.

Visual Studio Autos Window

Hey all.

I’ve used the Autos window from time to time and generally pleased with what it provides: auto exception variables, locals, etc..

I was just looking at this today again under a different scenario (small method that taps into .net classes), and noticed that VS put in more level of variables in the window that can be a quick helping hand at times.Visual Studio autos window

Neat, huh??

 If you don’t have the window visible, check under your Debug menu of course 😀