Visual Studio 2010 Not Copying DLL References

I had this issue recently when looking at someone elses solution.

Project A had a reference to project B, but when you tried to compile it would fail on Project A (because it couldn’t find any of the classes in project B) and the assembly for project B would not be copied to the BIN of Project A!

The errors looked like this:

C:WINDOWSMicrosoft.NETFrameworkv4.0.30319Microsoft.Common.targets(1360,9): warning MSB3253: The referenced assembly “MyAssemblyName” could not be resolved because it has a dependency on “System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” which is not in the currently targeted framework “.NETFramework,Version=v4.0,Profile=Client”. Please remove references to assemblies not in the targeted framework or consider retargeting your project.

After a lot of messing around it turned out that the “Target Framework” for Project A had been changed to “.NET 4.0 Client Profile” instead of just plain old “.NET 4.0”.

Change it back and rebuild: it’s that simple.

 

 

List of .Net Dependency Injection Containers

From Scott Hanselman:

http://www.hanselman.com/blog/ListOfNETDependencyInjectionContainersIOC.aspx

I’m considering trying out PicoContainer which happens to be developed by Atlassian, a company I had been researching recently regarding their “20% Time” implementation.

 

Still Having TFS Merge Problems

I’ve tried baseless merges, forced merges, regular merges…. nothing ever “takes” (even though the changes TO get committed, TFS keeps thinking there are unresolved changes that need to be merged next time I do a merge).

Here are some screen shots of the crazy merges I’m trying with the 2 issues that never resolve.  Click for bigger picture:

UPDATE: I think we’ve resolved the problem.  There was a nonexistant file that had a mystery pending change that would never get resolved.  I undeleted it, merged this change into the file, then deleted it again, and merged that change doing a baseless merge, and it seemed to go away.

Code Review with TFS

I’ve been searching for some tools to use with TFS to help with doing code reviews.

So far the options I have found that seem worth considering are:

TeamReview

Malevich

Code Collaborator

 

TeamReview looks like the option I’m going to try first.  It’s supposed to be fully integrated into the IDE, but I’m not sure how the “replay review” thing will work.  It’s supposed to highlight the same code that you hightlight during the review, which I guess can work, I’ll see how it goes.

Malevich is a web based tool that integrates into TFS, but it’s an open source project with few users, and when I see that I tend to think that it will be a major pain to get working.

Code Colaborator is something you pay per user, about 500 bucks, which is pretty darn expensive.  I’d really like to find an option that doesn’t cost several thousand dollars per year.

I’ll see how TeamReview goes and I’ll post my thoughts here.

 

ASP.NET Buttons, OnClientClick, Javascript Confirm, and UpdatePanels

I’m not sure if this problem is a case of me using a button inside an update panel (most likely) or something new with ASP.NET 4.0 (we’ve noticed a lot of random differences between 2.0 and 4.0 in how some controls that seem unchanged between versions are actually rendering different html).

I had a button with a JavaScript confirm message inside an update panel.  So that looked like this:

OnClientClick="return confirm('Are you sure you want to commit your current changes?');"

but no matter what you selected the button would not trigger a postback.  The rendered HTML showed why.

onclick="return confirm('Are you sure you want to commit your current changes?'));
   __doPostBack('cmdCommitChanges','')"

(I wrapped that line for easier reading).

So you can see that we are never even reaching the __doPostBack that is added by asp.net because of the return statement.

To fix this, just chnage your OnClientClick to:

OnClientClick="if (!confirm('Are you sure you want to commit your current changes?')) return;"

 

multiple connections to a server or shared resource

From time to time I get this stupid error when connecting to a machine:

multiple connections to a server or shared resource by the same user are not allowed

I finally found the solution.  Just open up a command prompt and run:

net use * /delete

It will ask you if you want to delete all your open connections, say yes, and then try to reconnect using the credentials you want. 

Success!

Computer Browser service starts and then stops

I was having problems locating a machine by name on my local network. 

After some poking around I noticed that the computer browser service on the machine was not running, and when I tried to start it it would immediately stop.  Searching the event log showed that it wasn’t even throwing an error… just stopping.

After a lot of poking around I found that if I enabled File and Print Sharing in my firewall rules that the service would keep running, and now I can look up the machine by name on my local network without problem.

TF30177

TF30177: Team Project Creation Failed

Are you getting this error with TFS 2010?  It seems to happen to me if use a project name that includes a “.” like “SomeProject.com”.

Drop the “.com” and it will work.