Visual Studio 2010 Professional Find and Replace Not Working - visual-studio-2010

My find and replace has stopped working.
Background:
I have a paid version Visual Studio 2010 installed. I also was running a trial version of Ultimate. However, the trial expired so I un-installed Ultimate. After the un-install of Ultimate, I can no longer do a global search in VS Professional.
Anyone have any ideas? Where should Microsoft.VisualStudio.Progression.GraphModel reside and why is it causing my search to fail? I tried running a repair on VS Professional without luck.
Error Message:
In the find results, I get the following:
Find all "test", Subfolders, Find Results 1, "Current Project"
The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.
1) Could not load file or assembly 'Microsoft.VisualStudio.Progression.GraphModel, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Resulting in: An exception occurred while trying to create an instance of type 'Microsoft.VisualStudio.Fragments.LanguageContext'.
Resulting in: Cannot activate part 'Microsoft.VisualStudio.Fragments.LanguageContext'.
Element: Microsoft.VisualStudio.Fragments.LanguageContext --> Microsoft.VisualStudio.Fragments.LanguageContext
Resulting in: Cannot get export 'Microsoft.VisualStudio.Fragments.LanguageContext (ContractName="Microsoft.VisualStudio.Fragments.ILanguageContext")' from part 'Microsoft.VisualStudio.Fragments.LanguageContext'.
Element: Microsoft.VisualStudio.Fragments.LanguageContext (ContractName="Microsoft.VisualStudio.Fragments.ILanguageContext") --> Microsoft.VisualStudio.Fragments.LanguageContext
Resulting in: Cannot set import 'Microsoft.VisualStudio.Fragments.EventsManager..ctor (Parameter="languageContext", ContractName="Microsoft.VisualStudio.Fragments.ILanguageContext")' on part 'Microsoft.VisualStudio.Fragments.EventsManager'.
Element: Microsoft.VisualStudio.Fragments.EventsManager..ctor (Parameter="languageContext", ContractName="Microsoft.VisualStudio.Fragments.ILanguageContext") --> Microsoft.VisualStudio.Fragments.EventsManager
Resulting in: Cannot get export 'Microsoft.VisualStudio.Fragments.EventsManager (ContractName="Microsoft.VisualStudio.Fragments.IEventsManager")' from part 'Microsoft.VisualStudio.Fragments.EventsManager'.
Element: Microsoft.VisualStudio.Fragments.EventsManager (ContractName="Microsoft.VisualStudio.Fragments.IEventsManager") --> Microsoft.VisualStudio.Fragments.EventsManager

Found out what was wrong. The reason I switched to Ultimate to begin with was to use this plugin called Code Bubbles (which required Ultimate). When I switched back to Professional after my trial expired, the plugin got into a strange state that was causing other parts of Visual Studio to fail. Once I fully uninstalled the plugin, search returned to normal.

Strange. Have you tried using ctrl + break? As suggested here:
Search stops working for "Entire Solution"
... you should click inside the Find Results window, not the Output window. Once the
blinking text cursor is visible, hit ctrl-break four or five times. That should do the
trick.
- DJ Couchy Couch

Related

CefSharp shows a blank page when run outside Visual Studio

I'm trying to create a C# class library which consists of a form with CefSharp WinForms browser inside it. The library is used by another application as a plugin. The application is set to run when pressing "start" in Visual Studio. Launching the application this way works fine and CefSharp browser shows up and works as it should.
The problems begin when I try to launch the application from the filesystem. This time the form opens, as well as the DevTools, but the CefSharp browser won't appear and the DevTools form/window is blank. The applications trace files show that the it indeed does load the CefSharp DLLs:
15.56.32.202 Requested assembly CefSharp.WinForms (version 51.0.0.0) LOADED from file C:\*PATH_TO_THE_FILES*\CefSharp.WinForms.dll (version 51.0.0.0)
15.56.32.205 Requested assembly CefSharp (version 51.0.0.0) LOADED from file C:\*PATH_TO_THE_FILES*\CefSharp.dll (version 51.0.0.0)
15.56.32.243 Requested assembly CefSharp.Core (version 51.0.0.0) LOADED from file C:\*PATH_TO_THE_FILES*\CefSharp.Core.dll (version 51.0.0.0)
The same trace file logs all thrown exceptions and in this case there are none.
Some other things to note:
- I'm using Visual Studio 2015 Community Edition
- I'm building this for an x64 CPU.
- I've tried both Debug and Release built files, both work through VS and both fail without VS
- I've made sure I have all the files mentioned here in the folder where from CefSharp is loaded
- I have Microsoft Visual C++ redists installed (11.0, 12.0, 14.0)
- Also tried including the msvcp120.dll & msvcr120.dll and their debug variants in the output folder (just in case).
- I've tried both CefSharp versions 51 and 57, behavior stays the same
My only guess is that, under the hood, Visual Studio includes references to some vital files/components/dlls/whatever that are not there when launching without it.
UPDATE
I tried debugging this further and attached methods to following events:
LoadingStateChanged
ConsoleMessage
I created a test html page running on localhost which just calls console.log() with a simple message. The message is written to trace by the method attached to ConsoleMessage and when running from VS it's written to trace as it should. Without VS, it's not.
The method attached LoadingStateChanged wrote to trace the value of IsLoading property of the second parameter LoadingStateChangedEventArgs e. Running with or without VS both wrote the same thing: first true and then false. The ConsoleMessage was logged between these lines in trace when running with VS.
Furthermore, I tried disabling hardware acceleration with:
CefSettings settings = new CefSettings();
settings.CefCommandLineArgs.Add("disable-gpu", "1")
but that didn't help either.
The problem was, as I suspected, related to missing references.
Adding the files of the VS output directory (bin/x64/Debug) to the external application's executable folder solved the problem.

MVC Scaffolding Error, deps.json does not exists

I'm following along with the Contoso University and I'm running into the HP Computer Platform issue mentioned in this SO question about the scaffolding creation error saying deps.json does not exists in a certain folder.
I'm running Windows 7 Professional and using Visual Studio 2017 Community.
I have changed my Environment Variable, Platform, from BPC to nothing by using set Platform= in command prompt.
Still I get an error when I try to Right Click on the Controllers folder > Add > New Scaffolding Item... > MVC Controller with views, Using Entity Framework > Fill out the form by picking a Model class and Data context class > Add >
Error
There was an error running the selected code generator:
'The specified deps.json [C:\...\bin\BPC\Debug\netcoreapp1.1\ContosoUniversity.deps.json] does not exists'
I have tried cleaning cleaning the solution, restarting Visual Studio 2017, and rebooting my computer to no avail.
Not sure what else I should do to prevent this error. Any suggestions? I feel like copying the files into the BPC folder is a workaround, but not the best solution.
Edit 1
I noticed that the Environment Variable, Platform, got reset to BPC, so I deleted it and rebooted again. Didn't come back.
Now when I try to create the scaffold I get this error:
Error
There was an error running the selected code generator:
'Value cannot be null.
Parameter name: connectionString
at
Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.<BuildCommandLine>b_6_0()
at
Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
at
Microsoft.VisualStudio.Web.CodeGeneration.CodeGenCommand.Execute(String[] args)'
Edit 2
Setting the Platform variable back to BCP manually brings back the original error.
Copying and pasting all files from ...\ContosoUniversity\bin\Debug\netcoreapp1.1\ to ...\ContosoUniversity\bin\BCP\Debug\netcoreapp1.1\ gets me past that error, but the error from Edit 1 comes back.
Seems I have two separate problems.
Turns out I made a typo in appsettings.json
I had "ConnectionString" instead of "ConnectionStrings" with an 's'
That was causing my Value cannot be null. Parameter name: connectionString error
So, to solve my original problem, follow these steps for Windows 7. (10 shouldn't be much different):
Windows key > Right click on Computer > Properties > Advanced system settings > Environment Variables... > Under System variables find Platform > Highlight Platform > Delete > OK
make sure .json file exists in path specified. and let me know about that what you find.

Webmatrix crashes when site is opened or created

When I open WebMatrix it works without problem and shows the start page.
When I click 'My sites' and choose my site or choose My site by click 'Open'=> My site or create new site (and choose the site type: Empty, App Gallery or Template Gallery) WebMatrix crashes. Note: It crashes when it needs to show the site pages.
I tried to re-install WebMatrix but that didn't help. I also tried to change the Workspace(by clicking 'Options' on the start page).
When it crashes, I get the message 'Windows is looking for a solution to the problem.' (My computer isn't in English so that might not exactly be the words) and then I am asked if I want to close/debug the program. I click 'Debug' and choose Visual Studio. I don't know how to debug a program, but I tried and it says to me that:
System.NullReferenceException was unhandled
Message: An unhandled exception of type 'System.NullReferenceException' occurred in Microsoft.WebMatrix.Core.dll
Additional information: Object reference not set to an instance of an object [-translated].
I have searched on the internet and here and I didn't find any solution to my problem.
Actual Answer
This bug is in the market for a time now. I have seen similar issue on another forum too, where the user was facing the same issue and same thing he tried but all in vain.
I think you need to wait for the next Update for your System, or try removing each and every component that WebMatrix installed, that means all the .NET Frameworks (4th version), Sql Dependencies Sql Server Ce, and all other files that were shipped along with WebMatrix to your computer. Remove them, and start the installing process once again freshly.
If nothing does the job, please uninstall WebMatrix 3 and install WebMatrix 2: Click here for link. I know it is awkward to go back a version, but you'll have to. Secondly you can mention this bug on their support/suggestion page. They would fix it.
http://webmatrix.uservoice.com/
I hope that would help you. And you'd be back in developing the apps :-)
Just for information
Secondly, do you understand what is meant by debug? Debugging is a method or process to remove the bugs from a software or an application etc. When you chose Visual Studio, it provided you or not provided you with the WebMatrix source code, I am not sure I never tried it. And you tried out debugging it. The exception is gave you, was a message saying that the parameter you're passing onto the next stage is a null. Which means it doesn't even exist and thus the value or the method cannot be executed and it breaks.

How to debug in VS instead of JIT Debugger?

UPDATE: navigating to the process via menu:DEBUG / Attach Process / iexplore.exe shows "Automatic: Silverlight code". i.e. VS 2010 already attached to the process. Why doesn't it go to debug view?
I have a frustrating debug behaviour going on on my laptop which I'd like to fix. I was following along with the demo called Silverlight TV 46: What's Wrong with my WCF Service?
On my computer, I noticed that putting throw new ArithmeticException() in the RIA service causes the just-in-time debugger to get involved (a bad thing -- I want VS). I can put a break point on the the throw new ArithmeticExpression() line, and VS stops as it normally does. Press F10, and I still get the just-in-time debugger kicking in.
On Yvor's computer (the presenter in the Ch 8 link above), the visual studio debugger kicks in instead of the just-in-time one. What am I doing wrong? Could having Redgate Reflector installed previously have caused this (it is gone now).
ERROR:
Visual Studio Just-In-Time Debugger
Code: 4004
Category: ManagedRuntimeError
Message: System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid.
Check ...
Possible Debuggers:
New instance of MS VS 2010,
New instance of VS 2008.
[checked] Set currently selected debugger as the default.
[unchecked] Manually choose the debugging engines
Action: Hit Yes.
2nd ERROR:
Unable to attach to the crashing process. A debugger is already attached.
I've spent several hours looking for a way to solve this.
Browser is IE9 / Silverlight 4.
Previously, I started starting the silverlight app directly via the VS2010 environment... but then decided to get more deployment compliant (again).
http://msdn.microsoft.com/en-us/library/cc838267(VS.95).aspx
Down the bottom they mention repairing from control panel / VS2010. Did that. Waited for ages, made coffee, did something else. Finally complete. Problem sill there. Included this step just-in-case the fix is cumulative (you get superstitious after a while with these things).
I then deleted zap files, switched startup page from html to the aspx one. Wired aspx to the xap (it wasn't pointing to the /debug/ folder). [note: looks like you can remove the debug via Silverlight Project / build / Output path: Replace Bin\Debug\ with Bin. With Silverlight I feel that the relative Uri path should match up to your html / aspx files no matter what -- wheather you are in Debug or Release.
project properties / Web / Specific Page
debugging works again!
Did .html stop debugging? Casual inspection reveals the same javascript stuff firing up Silverlight. On the surface it looks the same. hmmm. I guess it isn't.
... here are a few extra things to look at for those who still have issues (I may as well list them
while they are fresh in my mind).
project / properties / Web / Debuggers: I now only have Silverlight checked. ASP.Net is not checked any more. (Not sure if this influences my result at this stage)
make sure your web project points to the silverlight project in project / properties / Silverlight Applications. This ensures that the silverlight project's binary "xap" is copied to a folder within the Web Site / Web App. Note: hitting the add button reveals a destination folder (should be ClientBin).
Your build configuration will add an additional sub foler e.g. debug.
Make sure your .aspx or .html files have the right path. For me, I just included the .ClientBin/debug/ folder. I don't think this is deploy friendly, so I will search for a better way later.
IE9 settings.
[X] Disable script debugging.
[X] Disable script debugging (Other)
[ ] Display notification about a script error
[ ] Show friendly HTTP error message
Again, unsure if these later setting have an impact.
Lastly, there's something that I forget about sometimes. Be sure to check Debug VS2010 / Exceptions / Common language Runtime. This ups the ability to catch exceptions.
I had a similar problem, but the above did not resolve it. However, starting the application without debugging (Ctrl-F5) and triggering the exception would allow me to select the Visual Studio instance that I started the application from. Amazingly, I got a sensible stack trace and resolve the problem within a few minutes.

Visual Studio cannot find debuggerutils.h

I've installed Visual Studio 15.9.0, Preview 3 and created a project using the new platform support for C++/winrt. The project runs fine until I set a breakpoint. When the break is hit VS tells me "You need to find debuggerutils.h to view the source for the current call stack frame" It tells me this file was originally at onecore\com\combase\inc\debuggerutils.h, though it doesn't tell me the path to onecore. Search can't find such a file. Does anyone know how to find that file or install it? I had just assumed that VS would automatically include debugging capability.
[Update] Appears it is not the setting of a breakpoint but a bug causing a break before that. But I'm still mystified by the error message.
Someone asked this question on github's WinObjC issues:
https://github.com/microsoft/WinObjC/issues/2931
From the discussion:
edvv commented on Nov 22, 2019
Ah, now I remember what this means: "This is a false message. What really happened is that your app silently terminated (maybe by a console abort(), i.e.: crashed ) and when the app failed to launch (aborted) the front end gave that message. You need to look at the Windows Console window in VS while in debug mode."

Resources