I began to receive the error message box in Visual Studio after a restart from an install of an unrelated to test Visual Studio plugin (which I have used in the past):
The ‘TestWindowPackage’ package did not load correctly. … examining the file … AppData\Roaming\Microsoft\VisualStudio\12.0\ActivityLog.xml
Looking at that log showed these errors:
TestWindowPackage.Initialize failed with exception … System.InvalidOperationException:
Loading MEF components failed with the following exception: The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.
…
No exports were found that match the constraint: ContractName Microsoft.VisualStudio.TestWindow.VsHost.PackageContainer RequiredTypeIdentity Microsoft.VisualStudio.TestWindow.VsHost.PackageContainer
To resolve the issue I did step 1 and 2 but am showing step 3 in case it helps.
Close all instances of Visual Studio.
Delete all files in `AppData__abENT__#92;Local__abENT__#92;Microsoft__abENT__#92;VisualStudio__abENT__#92;12__abENT__#46;0__abENT__#92;ComponentModelCache` Note that directory is not found in `Roaming` as the activity log file, but in `Local`.
Restart, if that doesn’t work then start over with step 4.
From a Visual Studio Command Line do this operation: `devenv __abENT__#8260;setup __abENT__#8260;ResetSkipPkgs` See (/Setup (devenv.exe)) for more information.
(Update 4/27/2015 Added Asp.net intellisense failure)
I was running the latest version of Visual Studio 2013 and ran into the intellisense not automatically popping up when I would type a period. Now I could hit CTRL-J (list members) and it would pop up the list which showed me that it worked and was not dead per se, but I still did not have it automatically popup after typing a period. I was also running Visual Studio 2012 on the same box and it did not have the same problem; intellisense popped the list up on the period. I thought, “This ends here” and researched it. Here is what made it auto pop for me:
In quick launch type “Statement Completion” and choose the first one “Text Editor -> All Languages -> General” to be taken to the options page for all languages.
On the general options page in the “Statement Completion” section override whatever is in the boxes “Auto list members” and “Parameter Information” and makes those checked. Such as shown here:
That brought back the auto popup for me in VS2013 and should for you as well. This fix should work with any version of Visual Studio 2008, 2010, 2012 and 2013.
Still having problems? Then see Using Intellisense on MSDN for other troubleshooting suggestions.
ASP.Net
It has been reported that ASP.Net users are experiencing a different kind of intellisense failure. If it is web related intellisense look into installing Visual Studio Web tools. See
This is a How To Fix when you have downloaded a foreign (to your computer) assembly which can occur when dealing with Silverlight assemblies but it applies to all assemblies downloaded. Here is more of the errors:
error MSB4018: The "ValidateXaml" task failed unexpectedly.
error MSB4018: System.IO.FileLoadException: Could not load file or assembly ‘… \ImageSequence.dll’ or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
The situation is that the OS has identified that the assembly was not made on the computer and has been blocked. This is usually the case with downloaded assemblies and is a security feature.
Steps To Resolve
In Visual Studio in the Solution Explorer Window right click on the project which contains the dll and select Open Folder in Windows Explorer.
In Windows Explorer find the dll in question and right click and select Properties.
Select Unblock and select OK. (As shown below)
Rebuild.
Once you see the properties and this text its more self explanatory than the Visual Studio error.
This file came from another computer and might be blocked to help protect this computer.
Why?
Remember that .Net is an Xcopy install. Meaning that any .Net application can be installed by simply copying over the assemblies. The OS recognizes the assemblies and categorizes them for running. When one copies code over and tries to manipulate it in Visual Studio the OS blocks for safety reasons and it subsequently fails during a Visual Studio build.
In researching a MSDN forum question I needed to see the current user’s credentials during a custom action during an Setup and Deployment project created from a Visual Studio 2005 project. My goal was to show a message box during install that would display the user’s credentials and domain.
What makes this project unique is that we will be using MessageBox, from the System.Windows.Forms namespace. This article shows you how to utilize a MessageBox in a custom action. Here are the steps
Then in the install project unlike the Walkthrough, add the custom dll to the Custom Actions operation in the Install Node.
Build and install. Note the message box may come up behind other windows during install, so you may have to look.
This is a quick way to show information during an install for debug purposes or user info. Note it is a modal dialog and will stop processing until the user closes the message box window.