I don't think deleting vsmdi and testrunconfig files would help.
But yes, if you unload the solution, you should be able to bring up the windows. The problem comes in when your solution *is* the one that contains test projects which you want to execute tests on.
In any case, if the suggestion or workaround does not work for you, please let me know. Thanks!
Winnie
I assume this is not just for your solution, and is across all projects?
No, that's not correct. Today I created a new solution, and was able to add unit tests, and the tests show up in the Test View.
My guess is something has gotten corrupted in the other solution. I've been doing a bit of renaming in it (namespaces, assemblies, directories), maybe this is the cause of the problem. I'll try to figure it out later.
Tor.
I wouldn't worry that you have a corrupted solution or installation. This particular exception usually indicates a missing assembly reference. That is, at some point an assembly in team system referenced another assembly that wasn't in memory and could not be located.
Did you install the Team Foundation client with VSTS? Does the problem you reported occur if you launch the IDE and don't load any solution whatsoever? Does the problem still repro if you load the original solution?
Michael
I think you might be on to something here with the namespace/assembly renaming. I do remember seeing at least one existing bug in Beta 2 related to errors caused by renamed assemblies and namespaces. I've also experienced unhandled exception pain related to connecting to multiple separate TF server installations with Beta 2 because of a known cache bug (the first one you connect to would get cached, but in a way that would corrupt your ability to access a second distinct TF server installation). The nastiness of this particular error message is that it doesn't give you much useful troubleshooting information other than the environment context you can remember from before it happened. But I guess I should refrain from digressing into the tester version of Grumpy Old Programmer (
http://grumpyoldprogrammer.myblogsite.com ) :)
If you do get some time to figure this out and get it isolated please keep the feedback coming with your repro steps, etc. Your participation really is making a difference, links to these forum posts are added right there in the work item tracking system so it is a nice communications channel for us.
---
Eric Jarvi
http://blogs.msdn.com/ejarvi
Hi,
If you are successfully creating and working with TV in a fresh project/solution, it sounds like something in the project or solution is broken.
What we have experienced is this error when the solution file CPU-flavour references become corrupted (mostly from moving Solution files from old versions of whidbey).
1: Open the .sln file in notepad
2: Change All References to"AnyCPU" (note the missing space) to "Any CPU"
3: Save
4: Open the solution again
Yours,
Dominic
Unfortunately I had my harddisk crash on Friday, and the project(s) where I experienced the error were lost (at least temorarily until I know whether the disk can be rescued).
I'll keep my eyes open, and report here if I can reproduce the problem.
Thanks for all feedback,
Tor.
I'm currently experiencing this problem. I have not yet found the source of the problem or a work-around, but, in my case, the problem is related to a deployment project that was added as the ninth project in a solution which contains a web site and several other projects for the application. If I remove the deployment project from the solution, the Manage and Execute Tests interface will appear and the list of tests will populate, but, when I add it back in, I either receive the error the original poster reported, or no error and an empty test list. If I find the source of the problem, I will report back here.
I've been having the exact same problem. For me, the problem started when I added a Web Deployment Project into my solution.
The solution has:
Data Class libraries (in their own project)
Business Class libraries (in their own project)
Web Site
Unit Test project
Web Deployment project
When I go to the "Manage and Execute Tests" menu item, I get "Exception has been thrown by the target of an invocation."
Using SourceSafe to check "what changed" between the version that worked, and the one that didn't, the answer turned out to be the Web Deployment project.
I can:
1 - Launch VS.NET 2005 Beta 2
2 - Click on "Manage and Execute Tests" and get the exception
3 - Remove the Deployment project from the solution
4 - Click on "Manage and Execute Tests" and have it work.
(No restarting of VS.NET 2005 needed in the above 4 steps).
I did try reporoducing this in a new solution, but was unable to get a similar failure.
--
Chris Mullins
If a "Web Setup Project" Deployment project exists within your solution, the "Manage and Execute Tests" feature will not work properly. I will submit a bug report after posting this message.
Here are the steps to reproduce the problem:
1. Start Visual Studio 2005 Beta 2.
2. Create a new Visual Basic Windows Application Project, allowing Visual Studio to create a solution for the project at creation time. It is not necessary to add the project or solution to source control.
3. Close the default form opened after the project has been created.
4. Add a new "Test Project" project to the solution (in the Add New Project Window, select "Test Projects", then "Test Documents", then "Test Project".)
5. Close the two default test project windows.
6. Do a "Save All".
7. Close the solution.
8. Open the solution.
9. Select "Manage and Execute Tests" from the Test menu.
10. In the Test Manager window, observe the three default test list options in the upper-left pane ("Lists of Tests", Tests Not in a List" and "All Loaded Tests")
11. In the Test Manager window, click "Tests Not in a List" and observe the presence of the two default entries in main content pane of the Test Manager window, "manualtest1" and "TestMethod1".
12. In the Test Manager window, click "All Loaded Tests" and observe the presence of the two default entries in main content pane of the Test Manager window, "manualtest1" and "TestMethod1".
13. Close the Test Manager Window.
14. Add a new "Web Setup Project" project to the solution (in the Add New Project Window, select "Other Project Types", then "Setup and Deployment", then "Web Setup Project".)
15. Close the default "File System (ProjectName)" window.
16. Do a "Save All".
17. Close the solution.
18. Open the solution.
19. Select "Manage and Execute Tests" from the Test menu.
20. You will either receive the "Exception has been thrown by the target of an invocation" error, or you will see the Test Manager window.
21. If you see the Test Manager window, continue with the following steps.
22. In the Test Manager window, note the absence of the three default test list options ("Lists of Tests", Tests Not in a List" and "All Loaded Tests"), in the upper-left pane of the Test Manager window.
23. In the Test Manager window, note the absence of the two previously visible default tests, "manualtest1" and "TestMethod1".
24. Do a "Save All".
25. Close the solution.
26. Open the solution.
27. Remove the "Web Setup Project" Deployment Project from the solution.
28. Do a "Save All".
29. Close the solution.
30. Open the solution.
31. Select "Manage and Execute Tests" from the Test menu.
32. In the Test Manager window, observe the three default test list options in the upper-left pane ("Lists of Tests", Tests Not in a List" and "All Loaded Tests")
33. In the Test Manager window, click "Tests Not in a List" and observe the presence of the two default entries in main content pane of the Test Manager window, "manualtest1" and "TestMethod1".
34. In the Test Manager window, click "All Loaded Tests" and observe the presence of the two default entries in main content pane of the Test Manager window, "manualtest1" and "TestMethod1".
I've reported this as a bug, and it is currently being reviewed.
The bug ID is FDBK29360.
Bug URL:
http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=25c7ff73-2478-46d3-8c78-ce6b644a2a03
Thank you very much for reporting the bug.
I have checked that this bug has already been fixed for the RTM version of the product.
The only known workaround is to remove the setup project for the solution. Sorry for the inconvenience caused.
Thanks!
Winnie
I had a similar problem with a Sql Server Integration Services Project in my solution..
by Unloading the solution, i could again Manage and View the Tests.
I had also deleted the .vsmdi and .testrunconfig files from the solution... although i'm not sure if it was needed, so vs.net would generate new ones (I had to delete them via explorer, as vs.net wouldn't let me)
Hello,
I don't think deleting vsmdi and testrunconfig files would help.
But yes, if you unload the solution, you should be able to bring up the windows. The problem comes in when your solution *is* the one that contains test projects which you want to execute tests on.
In any case, if the suggestion or workaround does not work for you, please let me know. Thanks!
Winnie
ok, well. it seems that all i needed to do is leave it along for 30minutes and it worked. No joke. I think my computer is evoluting. =D Maybe it will make my code for me!! =)
yes deleting the .vsmdi and testrunconfig doesn't do anything..
i encoutnered the error once again when i added a Deployment project (.msi).
it seems that the error in vs.net is related to the test manager/system trying to parse/read/analyse certain types of Projects.
when i removed the deployment project from the solution, it all worked again
for what its worth, heres my 2 cents:
i had this same error a bit after i added a setup project to my solution. i didnt fix it by removing it, instead i found out that the problem was something else:
before i got the error, i propertied the setup project release folder to be shared to my home network so i could install it on the other pc. seems that un-sharing this folder fixed the error.
thanks for all the ones who replied to this post, somewhere in page 1 i remember i got the idea of unsharing from one of the posts which i cant remember right now.
enjoy
Hi All,
In my UI Layer I am raising the Exception Divisible by Zero.
In Catch block of UI Layer I am calling the Business layer function to write this exception into Event Viewer
After the Exception writes into the Event viewer the control come back to UI Layer of Catch block.
When I am getting the error like “Exception has been thrown by the target of an invocation.”
If you know the solution for this problem, please reply to this mail.
I am using
.Net 2.0, Application Block 2.0 and XP Professional
See the Following Code
Business Layer
public interface ICommonFunctions
{
void LogErrInToFile(Exception ex);
}
public class CommonFunctions : MarshalByRefObject, ICommonFunctions
{
public bool LogErrInToFile(Exception ex)
{
bool boolError = ExceptionPolicy.HandleException(ex, "ExceptionPolicy");
}
}
UI Layer
try
{
int i = 1;
int j = 0;
int k = i / j;
}
catch (Exception ex)
{
bool boolError = objCF.LogErrInToFile(ex); //Error occurs after the control comes from Business layer.
}
finally
{
}
Error
System.Reflection.TargetInvocationException was unhandled
Message="Exception has been thrown by the target of an invocation."
Source="mscorlib"
StackTrace:
Server stack trace:
at System.RuntimeMethodHandle._SerializationInvoke(Object target, SignatureStruct& declaringTypeSig, SerializationInfo info, StreamingContext context)
at System.RuntimeMethodHandle.SerializationInvoke(Object target, SignatureStruct declaringTypeSig, SerializationInfo info, StreamingContext context)
at System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object target, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Soap.ObjectReader.Deserialize(HeaderHandler handler, ISerParser serParser)
at System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize(Stream serializationStream, HeaderHandler handler)
at System.Runtime.Remoting.Channels.CoreChannel.DeserializeSoapResponseMessage(Stream inputStream, IMessage requestMsg, Header[] h, Boolean bStrictBinding)
at System.Runtime.Remoting.Channels.SoapClientFormatterSink.DeserializeMessage(IMethodCallMessage mcm, ITransportHeaders headers, Stream stream)
at System.Runtime.Remoting.Channels.SoapClientFormatterSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Thames.OSS.Interfaces.ICommonFunctions.LogErrInToFile(Exception ex)
at OSSThickClientProject.ProfileManagement.profileManagement_Load(Object sender, EventArgs e) in D:\GISADS3\OSSThickClientProject\ProfileManagement.cs:line 63
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at OSSThickClientProject.Program.Main() in D:\GISADS3\OSSThickClientProject\Program.cs:line 20
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Thanks in advance.
Regards
Rajaram.
Thnx buddy, I was facing the same problem while inovation of objects by using reflection
and i found de correct solution.
Hi guys, i'm having the same problem when adding an access db connection in server explorer. any ideas on this?thanks, dave
Hi
I got the same error "Exception has been thrown by the target of an invocation" when I run my solution under windows 2000. But when I run this solution on a pc running windows xp work fine.
Actually my VB6 COM object have three parameter and one of them is long some how it doesn't work in windows 2000. After spending time on it I passed all three parameters as string and it worked .
Here is my code that now worked on both 2000 and XP.
windows 2000 machine has only .Net framework 1.1
XP machine has .Net framework 1.1 and 2.0 but I make this solution in .Net 1.1
Dim lStatus As Long
Dim lTaskKey As Long
Dim objParam As Object
ReDim objParam(2)
lTaskKey= 15694
objParam(0) = lTaskKey.ToString() ' When I pass ItaskKey as long it gives an error on windows 2000
objParam(1) = "XYZ"
objParam(2) = "Server2"
' Late binding way
Dim objType As Type
Dim objObject As Object
objType = Type.GetTypeFromProgID("HR.Task") ' HR.Task is a VB6 COM
objObject = Activator.CreateInstance(objType)
lStatus = objType.InvokeMember("GetStatus", System.Reflection.BindingFlags.InvokeMethod, System.Type.DefaultBinder, objObject, objParam)
I hope this will help to some one.
thx
I'm having the sam problem
Im using VB in VS 2005.
The code is:
'This event is fired on the background thread
mobjQueueReader = New STARWorkFileListener.cWrkFleListener
AddHandler mobjQueueReader.UpdateThreads, AddressOf Me.UpdateTextBox
mobjQueueReader.StartListening(sCN)
It compiles with no problem but errs on the Addhandler the full message is:
System.Reflection.TargetInvocationException was unhandled by user code
Message="Exception has been thrown by the target of an invocation."
Source="mscorlib"
StackTrace:
at System.RuntimeMethodHandle._SerializationInvoke(Object target, SignatureStruct& declaringTypeSig, SerializationInfo info, StreamingContext context)
at System.RuntimeMethodHandle.SerializationInvoke(Object target, SignatureStruct declaringTypeSig, SerializationInfo info, StreamingContext context)
at System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object target, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.EnterpriseServices.ComponentSerializer.UnmarshalFromBuffer(Byte[] b, Object tp)
at System.EnterpriseServices.ComponentServices.ConvertToMessage(String s, Object tp)
at System.EnterpriseServices.ServicedComponent.RemoteDispatchHelper(String s, Boolean& failed)
at System.EnterpriseServices.ServicedComponent.System.EnterpriseServices.IRemoteDispatch.RemoteDispatchNotAutoDone(String s)
at System.EnterpriseServices.IRemoteDispatch.RemoteDispatchNotAutoDone(String s)
at System.EnterpriseServices.RemoteServicedComponentProxy.Invoke(IMessage reqMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.Object.FieldSetter(String typeName, String fieldName, Object val)
at STARWorkFileListener.frmWrkFileListener.Worker_DoWork(Object sender, DoWorkEventArgs e) in C:\Galaxy\Services\File Listener\STARWorkFileListener\frmWrkFileListener.vb:line 359
at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
Any Ideas what I may have missed?
Thanks
I am using VS2008 SP1 on x86 Vista
If you have any help for this problem, please email to
reprisethelung@live.com or just post on this discussion. Thank you very much for any time anybody puts into it.
I Have been having the same problem, but only after I did the following:
1. Installed VS2008 SP1 (.NET 3.5)
2. Installed the Silverlight 2.0 SDK
3. Then I created a VB.sln (for Silverlight)and played around with a Silverlight 2.0 project in VB/xaml/html/javascript/aspx and
everything was working great.
4. Then I tried to create a new .sln for a new C# Silverlight project, but got a message saying "C# compiler could not be created"
And was not be able to creat any C# .sln, including a C# Console Application.
5. Upon encoutering that problem, I did some searching and discoverd "Devenv.exe"
After running that, used "devenv.exe /ResetSkipPkgs", and then I was able to create all the types of C# .sln's.
6. I only get that message (posted below) in the design view while developing Silverlight apps in either C# or VB.
However, by clicking the 'Click here to reload designer', with one or two clicks, it usually goes away.
The only reason I post this is because the messages are scary, and it bugs me that something horribly wrong could be going on with Visual Studio. The software costed soooo much, and I care about the health of it. I reallize I am at fault for not researching "devenv.exe /ResetSkipPkgs" before entering it or trying to find all solutions to my compiler problem.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - THE MESSAGE THAT POPS UP IN DESIGN VIEW - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
An unhandled exeption has occured:
Click here to reload the designer
Details:
Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at MS.Internal.Package.MetadataLoader.InitializeProfileMetadata(RegistryKey registryRoot, String profile, LogCallback logger) at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.CreateDesigner(DesignerContext context) at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.CreateDesigner(IsolatedDesignerFactory factory, IDesignerContextProtocol contextProtocol) at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.CreateDesigner(IsolatedDesignerFactory factory, IDesignerContextProtocol contextProtocol) at MS.Internal.Host.Isolation.IsolatedDesigner.Load() at MS.Internal.Designer.DesignerPane.LoadDesignerView()
Could not load type 'System.Windows.Controls.WebBrowser' from assembly 'PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
at Microsoft.Windows.Design.Metadata.DeveloperMetadata.DeveloperMetadataBuilder.AddWebBrowserAttributes() at Microsoft.Windows.Design.Metadata.DeveloperMetadata.DeveloperMetadataBuilder..ctor() at Microsoft.Windows.Design.Metadata.DeveloperMetadata.get_CustomAttributes() at Microsoft.Windows.Design.Metadata.DeveloperMetadata.Initialize()