Gorgo.Live.ToString()

Mariusz, Gorzoch tech Blog

Archive for the ‘TFS’ Category

HRESULT E_FAIL has been returned from a call to a COM component

leave a comment »

I have a site hosting application with retrieve some data from TFS 2012 thru TFS API. It was working fine till someone restart. From that point I’ve started to get bellow error:

Error HRESULT E_FAIL has been returned from a call to a COM component.
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace:

[COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.]
   Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore.DataStoreNative.UpdateMetadata(IntPtr handle, Object rowset, String dbstamp, UInt32& changes) +0
   Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore.Datastore.UpdateMetadata(Object rowset, String dbstamp) +57
   Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.EndBackendCall(BackendCallData data) +275
   Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.RefreshCacheInternal(BackendCallData& data) +204
   Microsoft.TeamFoundation.WorkItemTracking.Client.WorkI
temStore.InitializeInternal() +565

I’m still looking for the solution, but what seems to work is:

– add user hosting web site to local admin on the machine

– add user hosting web site to project admins from with you retrieve data

– open team web access (TWA) on user hosting web site on your local machine

– open team web access (TWA) on user hosting web site on the server hosting the solution

This makes web site to work again. Some of above steps are for sure not necessary, but I need above problem to occur again to eliminate some of them. I’ll keep updating that post till I find what exactly is needed to fix above.

Once the web site is back again, then you can undo all above steps and the site will keep working even if you restart IIS.

Advertisements

Written by Mariusz Gorzoch

20 March 2014 at 13:04

Posted in TFS2012

Tagged with

Error HRESULT E_FAIL has been returned from a call to a COM component

leave a comment »

Recently I’ve develop MVC app to expose our TFS to our external customers thru really simplify interface (=Team web access is great, but let’s honest for no IT user it is to far complicated). After testing period on my box and ensuring that all security setup is ok (=we don’t want to show to our customers projects with do not concern them) I’ve deployed that app to one of our DMZ servers. Initially I’ve used one of standard TFS account to host it (the account used to host TFS web services). At that point everything was working fine, but of course that was temporary solution as on the end I preferred to use dedicated account. Unfortunately as soon I get such a account and grant proper access I’ve started to get error as below:

Error HRESULT E_FAIL has been returned from a call to a COM component.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
Exception Details: System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Resolution:

Just take your account and log with it on the server. That as I found is needed in order to create some temporary folder required by TFS API. Once I’ve did that and restarted IIS app pool hosting my app everything started to work correctly.

Written by Mariusz Gorzoch

3 March 2014 at 09:00

Posted in TFS

Tagged with

TFS 2012 Code review how to start

leave a comment »

Most common question when it comes to „code review” process is „how to start” ? In nut shell there are two approaches to do code review in TFS 2012 and Visual Studio 2012:

A. Not blocking approach (recommended for now)

In that approach you first check-in the code and then request review (post code review). Going for that way you ask for an feedback on things with you already placed in TFS.

clip_image002

How to do it :

1. Complete work around work item and check-in your changes

2. Go to history and find changeset associated with check-in from point 1

clip_image003

clip_image004

3. Request review

clip_image006

A: Enter people with you would like to do review of your code

The best people to choice to do code review are team members of your own project. Anyway if they are too busy then you can try to ask people from outside your project to do it for you. Not being member of your team project is not blocking code reviewers for proving you feedback.

B: Provide description of the change

C: Submit request

4. Done

Your request review should now be submitted to the reviewer and they should :

– Get email with information that review is pending for them

– They should see it in “My work” tab

clip_image007

B. Blocking approach

In that approach you don’t check in your changes but instead of that you request for review of changes with are pending.

clip_image009

In nut shell this process looks like this:

1. You complete your work and when you are ready to check-in then instead of using option “Check-in” you use “Request review”

2. You fill the “request review” form in similar way as described in point A.3 and submit your review

3. You suspend your work (all current changed) with help of new “suspend” feature in “My work” panel.

4. Now you can start working on new feature/work item

5. After a while you get feedback around code review.

6. You suspend your current work

7. Now you need to resume changes suspended in point 3

8. You review changes, adjust your code and check-in code or go for the next code review round

9. Once changes are check-in you resume your work from point 6

As you can see that approach is much more tricky and complex. This is the reason why I recommend to start from option A. Moreover that approach strongly relay on quick feedback around code review as it block your check-in and exposes you to long and boring marge process.

So, to do or not to do code review ? If you are still not sure if it is worth to go for it let me give you few proven reasons:

1. Finding bugs early, when they are cheap to fix.

2. Coding standards compliance. Code review helps to maintain consistent coding style across the company.

3. Teaching and sharing knowledge. During review team members gain better understanding of the code base and learn from each other.

4. Consistent design and implementation. Peer review helps to maintain a level of consistency in software design and implementation.

5. Higher software security. Applications that require a high level of security benefit from targeted security reviews.

6. Team cohesion. Review discussions save team members from isolation and bring them closer to each other.

7. Confidence of stakeholders. You build confidence of stakeholders about the technical quality of the execution.

Written by Mariusz Gorzoch

17 October 2013 at 18:55

Posted in TFS

Tagged with ,

Dear TFS why you reject my connection?

leave a comment »

It happend for me for the sixth time and now I decided to write this down, so I’ll not have to look for it again, when this problem hit me in the future again (and it will… I know the Murphy law). So what is the problem ? Did you ever established your brand new development enviroment on completly clean machine ! installed visual studio ! added Team explorer to it ! then, finally after 12 hours tried to connect to your corporate Team Fundation Server and bang, you get this criptic error message:
 
 
I did, and today it is at least 6th time when I hit the wall!
Now you started to think, what is the reason of the problem, and hire I puted some hints what it can be and what solve my problem each time when I get it:
 
1. DNS problem. Check if the machine from where you connecting can recoginze your corporate TFS server by name. As you know or not, even if you provide IP address of TFS, then Team explorer will connect to TFS and in response get redirection to the same server but this time, by name. If you station can not recoginze server by his DNS name, then you will stuck! How to solve this ? if you are not DNS admin and you just can not add your machine there, then you can go and use "host" file located at : "C:\WINDOWS\system32\drivers\etc". This is text file, where you can put IP address and then DNS name. Windows will use this file to resolve IP into DNS name.
 
2. Who am I?. This maybe sound strange, but this is the reason of secound problem I usually have. When you connecting to TFS you need to provide somehow creadenatils. And now is ticky question : what credential Team explorer will provide to your corporate TFS if there is no setting to set them up ? This is quite easy: he will provide credentials of currently logged users and if you are the "administrator" (developers are allways administrator on they dev stations :)), then you for sure stuck, as I don’t believe that password for your local administrator will match the one for TFS :). I hope that this thing Microsoft Visual Studio team will correct in the next version, so I’ll have option to provide not only server name, but also creadenatials to use. Anyway to overcome this problem I’m using component from "control panel" : "Control panel->Stored user names and passowrds". If you open this adding then he will show you the list of currently remembered logins for remote servers:
 
 
this component let you define login/password which this machine should use when connecting to remote server. As you can understand we will use this to tell windows to use special creadenatials when accessing our corporate TFS.
 
 
and when you put the credentials hit "Ok" button:
 
 
now you just need to "close" this window, restart you visual studio and try connect to TFS again. This time it should work 🙂
 

Written by Mariusz Gorzoch

16 June 2009 at 22:04

Posted in TFS