Webmatrix crashes when site is opened or created - webmatrix

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.

Related

Unable to start program 'http://localhost/Default.aspx'. VS2010

I cannot start my website from Visual Studio 2010 anymore.
For a few days I cannot start my project in a web browser using F5. When I open my web application directly by typing the same url 'http://localhost/Default.aspx' everthing works fine.
When I run the project (F5) a new webbrowser starts, but after a few seconds it is stuck and Visual Studio gives an error dialog:
Microsoft Visual Studio
Unable to start program 'http://localhost/Default.aspx'.
OK
When I run the project in release mode it gives an extra error:
Microsoft Visual Studio
The following module was built either with optimizations enabled or without debug information:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\6552bec6\694bce32\assembly\dl3\8c9bd8d8\fb1d75cb_af26cc01\[name].Presentation.DLL
To debug this module, change its project build configuration to Debug mode. To suppress this message, disable the 'Warn if no user code on launch' debugger option.
OK
I have already repaired, removed and reinstalled Visual Studio 2010, I've tried using different browsers (including Chrome and Firefox), used different aspnet_regiis.exe options, etc. etc.
Nothing helps, and yeah now I'm stuck pulling hair out of my head ...
Anyone any idea how to solve this?
Does it work if you start it with [CTRL]+[F5] which runs without the debugger?
If so, then you have an issue with the debugger auto-attaching to the web server. I would check that debugging is enabled for your web project - a warning that usually crops up automatically from VS when it detects that a project is not built in Debug mode.
This is not as simple as switching the project configuration over to Release, because the DLL that the debugger is moaning about is one of the dynamically generated ones originated by Asp.Net itself.
Typically you should have, in your web.config:
<configuration>
<system.web>
<compilation debug="true" >
</compilation
<system.web>
<configuration>
(Along with any other stuff in <configuration> and <system.web> nodes).
There's also the possibility that Asp.Net debugging is not, for some reason, enabled.
Check out this msdn article on debugging asp.net applications in VS2010 for more information.
Note that if this is VS010 express, then you won't be able to debug - as confirmed by the aforementioned link; but since you way it used to work then I guess that's not your problem.
Update
Since that hasn't worked - you can try emptying the Temporary ASP.Net files folder. Easiest first is to do an iisreset. Then navigate to C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files and delete everything in it. I've had issues in the past where the Asp.Net binaries don't get refreshed and so when I'm debugging it moans that the files are out of date.
Change the View Browser to another browser. Run the view in browser or debug, then change back to original browser should work after that.
Had same problem, answer for me was to remove Avast Free AV. Everything worked for a year with avast free up until a week or so ago, uninstalling it fixed the problem.
I had this exact problem with Visual Studio 2008. The solution was to set the default web browser that VS uses to a real browser (e.g. IE) and not the "Internal Web Browser".
Right click on an ASPX file in your project and select "Browser With...". This lets you select the default browser to use when you select the "View in Browser" option and for when you debug/run the app (this is key).
Select your favourite browser (i.e "Internet Explorer") and click on "Set as Default". Do not pick "Internal Web Browser".
Debug away! Your app should come up in your browser now and debug as normal.
the solutions for me is to test with 127.0.0.1 in place of localhost. and all goes well for.
so the problem come from the host resolution name, to solve it please proceed like :
open cmd and then tape : %systemroot%\System32\drivers\etc\
open hosts file with notepad and the look for localhost ligne(you'll find 0.0.0.0 befor it )
change the 0.0.0.0 with 127.0.0.1 at all lignes with localhost .
I solved in this way:
Right click on a aspx page
Browse with set internal browser as default
Remove the previous default browser
Add %programfiles(x86)%\internet Explorer\iexplore.exe
Set this choice as default
For me I just did a Build /ReBuild on the project level and it started working!!!
I had the same problem. When I debug my code it says:
Unable to start program 'C:\homework.exe'. this system cannot find the file specified."
I'm using Microsoft Visual C++ 2010 Express but when I made a new project by the following steps:
Open C++:
Press new project
Press win32
Press win32 Console Application
Rename it
Click next
make sure: that the application type is console application
additional options: empty project*
Press Ctrl+Shift+A
In Visual C++/Code section press C++ File (.cpp)
rename it and press add
It works fine with for me now.
Please set your page name e.g Default.aspx revert to parent in IIS configuration
I'll share my experience with this same problem. This is not a solution, but someone may be able to figure out the problem from my particular experience.
I've been having this same problem for a few weeks now. (I don't know what changed on my system.) I do not run as local admin, because we are not allowed to have admin privileges on our PCs where I work.
Until today, I could expect F5 (Start Debugging) to start up a new local VS web server, open an IE window, and then issue an "unable to start program http://localhost:nnnn/Login.aspx" and "access is denied" error pop-up. If I closed the IE window, waited a few seconds, and then clicked F5 again, it usually started up my web app in debug mode just fine from that point on.
But today, that all changed. I did not change any configuration on my web app, which has been running fine, but I did add a couple of more classes to one of my subprojects. At this point, I could never get past the "unable to start program" message. I could run my app without debugging, but that was rather pointless. I even tried attaching to a running (non-debug) IE process, but that did not work.
Finally, I modified some of the properties in the WebAppName >Web >Servers screen. Specifically, I enabled "Specific port" for a specific HTTP port (which VS had been using all along), and I disabled "NTLM Authentication". I also enabled "ASP.NET" in the Debuggers section. Some of these I first clicked, then unclicked, then clicked again, saving in between each click.
This time, running with debug (F5) worked.
After running several times, I still usually get a "unable to start" error the first time after a recompile, but I can still usually get a debuggable running app to start after the second or third try. At least I'm back to where I was yesterday.
I suspect it has do with VS reloading its execution profile, and also probably something to do with permissions (since I cannot run as admin).
I'm using VS2012 with an ASP.net app that was written using VS2003... I've tried everything to get the IE page to open automatically when I select F5, or even Ctrl+F5... Haven't been able to get anything to work... However, I have stumbled upon a very poor work-around. When I select debug and I get the 'Unable to start program...' msgbox... I noticed that on the icon-tray I get a msg saying local-host has started
You'll notice a picture that the msgbox is pointing to:
Well, if you right click it, you get three options:
When you select the first: 'Open in Web Browser', it will open IE with the page your working with...
Like I said, it's a very poor work-around... but it works. This isn't an issue when I select debug using 'Chrome' or the page-inspector... But they have their own issues.
Try to turn on Bypass proxy for local addresses.
First you can go to your browser settings-> Change proxy Settings-> Connection-> Lan Setting and just check bypass proxy for local addresses.
If this solution don't work then also copy the following code check your web.config file for settings to bypass firewall:
<system.net>
<defaultProxy>
<proxy usesystemdefault="true" proxyaddress="http://proxy:port" bypassonlocal="false" />
</defaultProxy>
</system.net>
I easily resolved this problem by enabling script debugging in the browser.
When I ran into this problem (using IE 11) I noticed that iexplore was open about a hundred times in the task manager. After killing them all I was able to open my project just fine.
Since then, I have made a .bat file with this code:
taskkill /F /IM iexplore.exe /T
so now I just run the .bat when I get that error.
(alternatively you could run that code from the cmd)
I just ran into this problem in Visual Studio 2013. I had to enable Anonymous Authentication.
Click on the project node in solution explorer.
Hit F4 to show the properties window.
Change the Anonymous Authentication option to Enabled.

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.

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

In Silverlight 4 app; what does this error mean?:
"Error HRESULT E_FAIL has been returned from a call to a COM component."
It's a very generic error. The VS debugger doesn't point to the exact location of the error when debugging.
This is kind of an old question, but I figured I'd give my answer since I found this thread by Googling for the exact same problem.
In my case, I'd copied some sample XAML from the web to get started with Silverlight Toolkit 4. That sample XAML contained a simple button with a click event handler that didn't relate to any handler that actually existed in my code behind. I didn't notice this simple problem at first, because the compiler didn't give me an error message, I just saw the "Error HRESULT E_FAIL has been returned from a call to a COM component" message above at runtime. It was only when I isolated my sample XAML by copying it into a brand new Silverlight application without any other content that the real underlying problem was revealed at compile-time.
So, if you've got the same error message at runtime, my advice is to check your XAML carefully for any errors that you had expected should have been picked up at compile time, but which for some reason ended up as the runtime error noted above. In order to debug, you can do what I did and isolate the code that's causing the error in a standalone Silverlight app with no other content, and see if like me you get a more helpful error message to guide you.
HTH.
There are many solutions out there but this is the only solution that worked several times for me.It has been tried on VS2012 VS2013 and VS2015, I find it working equally good for all.Just follow steps bellow to fix this issue
Step 1 : Close Visual Studio
Step 2 : Delete *.csproj.user and *.suo files
Step 3 : Reopen VS, and try to run project again in debug mode.
NOTE : This situation occurs when multiple users working on same
project with different VS versions .suo file is not supported
for round-tripping between the two VS versions.It contains information
about what settings current user has selected for his/hers VS working
environment.
In my situation:
I create a
class MyControl : ContentControl {
}
By default, the class is not public and XAML cannot load it and throw exception
Error HRESULT E_FAIL has been returned from a call to a COM component
Just change the scope of class to public and error disappear.
Hope this help.
PS. Microsoft should provide more on information than just throw a mystery error message without any stack trace.
I also had this error and I found that this problem is related to not have added all requiered assemblies to your project. In my case I was using a UserControl with a depency with the Silverlight Toolkit and I havent added this reference.
I just added the reference and everything solved :)
I had this error using the current SL4 Telerik controls. A similar issue has been reported here with a solution ... of sorts. The problem seems to be with the way Expression Blend manages the cache of controls.
Here's one way to generate this error, which I stumbled upon today. We have the following button in XAML:
<Button x:Name="button" Click="Button_Click" Content="Click me" />
The event handler that handles the button's Click event is as follows:
private void Button_Click(object sender, RoutedEventArgs e)
{
button.Margin = new Thickness(0, double.NaN, 0, 0);
}
When I click on the button I get the aforementioned error. The same error arises if I replace NaN with PositiveInfinity or NegativeInfinity.
Interestingly, I get a different error message if the first parameter of the Thickness constructor contains the NaN instead of the second.
I had this error from problems with XAML. The strange thing was that I had missing resources used by Style and Margin attributes - which means the app runs fine, and even resharper only reports a 'hint'.
Once I cleared up those problems my "Error HRESULT E_FAIL has been returned from a call to a COM component." disappeared. As others have said though, this is a vague error, very difficult to debug. In this case I have inherited a large project with 100's of VS and ReSharper messages with varying severity - missing StaticResource on Style attributes were not the first place I checked!
I had this error in my xaml page and there were no syntax errors. Cleaning and re-building the project solved my issue. fyi...
The IIS App Pool has to run as an account that has query access to the Team Foundation Server. This fixes the problem for me.
Most of the reason of this problem related dependency propertied on component design.
You just face off this problem on design.
Soulution is easy but takes time :) Clean project and rebuild all. When you enter the desing again you should see everything is fine!
I hope this helps!
If you see this exception recently, please try to re-install silverlight sdk4.
This is a security and permissions issue. Look into the IIS and make sure Integrated Security is ON. Then set Application Protection level to Medium (If it is high then this might be the result). Then check your Web.Config file. Make sure impersonation is off.
This should help.
I had this problem while I was encoding Live video and audio (using Microsoft Expression) and the next piece of code throws the exception randomly:
// Set bitrate
liveJob.OutputFormat.VideoProfile.Bitrate = new ConstantBitrate(2500);
// Set Video size
liveJob.OutputFormat.VideoProfile.Size = new Size(320,240);
until i've figured out that the second line throws the exception while the first one is still running in another thread !
and of course, it was my fault - i've called the method in code, and it was also been called by Click event...
I had this exception and went nuts. I would advice you check if you had recently installed a component that had possible conflicting namespace items. In my case I installed the windows phone tool-kit which had items that were similarly named with the stock tool kit on windows phone.
Asap I uninstalled this from the Nuget package manager, all was back to normal.
Here is what FINALLY fixed this problem for us when trying to use MICROSOFT.TEAMFOUNDATION library when querying Team Foundation Server:
Team Foundation Explorer has to be installed with the currect version that is referenced in the application.
MSDTC – Configuration. (See DTC config below)
IIS App Pool has to run as an account that has query access to the Team Foundation Server
IIS App Pool has to run as an account that has COM access on IIS Server (We have a dedicated server for this so we made the identity user an administer on the local server).
Firewall has to be off or configured to allow COM access for DTC service.
DTC config ----
Click Start, click Run, type dcomcnfg and then click OK to open Component Services.
In the console tree, click to expand Component Services, click to expand Computers, click to expand My Computer, and click to expand Distributed Transaction Coordinator.
Right click Local DTC, and click Properties to display the Local DTC Properties dialog box.
Click the Security tab.
In the Security Settings section, click Network DTC Access.
In the Client and Administration section, select Allow Remote Clients and Allow Remote Administration.
In the Transaction Manager Communication section, select Allow Inbound and Allow Outbound.
In the Transaction Manager Communication section, select Mutual Authentication Required (if all remote machines are running Windows Server 2003 SP1 or Windows XP SP2 or higher), select Incoming Caller Authentication Required (if running MSDTC in a cluster), or select No Authentication Required if some of the remote machines are pre-Windows Server 2003 SP1 or pre-Windows XP SP2. No Authentication Required is the recommended selection.
I hope this helps.
My problem was a missing Style. I had overridden a control template with a custom brush like so:
<Style x:Key="MyCustomStyle" TargetType="Thumb">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Thumb">
....
<TextBlock Foreground="{StaticResource MyCustomBrush}"
and was missing my definition of MyCustomBrush, like so:
<SolidColorBrush x:Key="MyCustomBrush" Color="#FFAC0909"/>
and then BOOM, app didn't startup and I got that COM error message.
Well, I was almost going to eat my computer..
At last, I find out the problem is that I MAYBE BY ACCIDENT removed one parameter of one Margin setting of an Image object in the XAML page, orz..
Margin="0,-20,0"
which should be
Margin="0,-20,0,0"
Obviously I didn't realized I have ever modified anything of the XAML, so I have been troubleshooting the code behind for "a little while"..
Fortunately, I found this post and rechecked everything include the XAML page.. that was ... something...
For me, I narrowed it down to a SplitButton control that I downloaded off CodePlex ages ago. I had upgraded the solution from Silverlight 4 to Silverlight 5 and got slammed with this error. I was able to narrow it down by commenting out the XAML to all controls then uncommented it back in one by one until the error appreared again:
System.Reflection.TargetInvocationException was unhandled by user code
Message=Exception has been thrown by the target of an invocation.
StackTrace:
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Delegate.DynamicInvoke(Object[] args)
at Homexaml_3.BindingOperation(Object BindingState, Int32 , Action )
InnerException:
Message=Error HRESULT E_FAIL has been returned from a call to a COM component.
StackTrace:
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.UIElement_Measure(UIElement element, Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
What fixed it was manually removing the outdated references System.Windows.Control and System.Windows.Controls.Toolkit then re-added them from the Silverlight 5 SDK folder.
Hope it helps someone (and helps me!) if it happens again a few months down the road.
I received this error recently in VS 2013 for a Silverlight 5 project. None of the above worked for me. Oddly enough, it was a threading problem (normally I am used to an exception that explains this if I am trying to create UIElements on a background thread by mistake).
Wrapping my code that adds UIElements to the MainPage with Dispatcher.BeginInvoke solved the problem:
Dispatcher.BeginInvoke(() =>
{
// your code
});
Most of the times its difficult to see where exactly the problem is located especially in XAML.
Another way to find out where its failing is to perform the following steps
Copy the exception it shows in the output window of Visual Studio. example. System.Reflection.TargetInvocationException
Click on Debug -> Exceptions. It shows up the exception list.
Click on the "Add.." button.
Paste the exception copied in the step 1 in the text box. Select "Common Language Runtime exceptions" in the drop down list.
Click on "Ok" button. The selected exception will be highlighted. Make sure you check the checkbox against the exception. Click on "Ok" button again to close the dialog.
Now run the application in debug mode. The application breaks when the exception occurs. Sometimes in the assembler mode as well.
At this point in time you have two options,
Click on the View details of the exception screen shown. Dig into
the inner exceptions until you get a clue from where its
originating.
View the call stack to see which code of line of your is causing
this exception. This will provide clues to resolve the issue.
For me, this was a XAML parsing error. In a data template, I had an extra S between two tags (probably because I pressed S instead of CTRL+S). For example...
<DataTemplate>
<Border/>s
</DataTemplate>
So, I would suggest you look for poorly formatted XML in the view that causes this exception when displayed.
In my case it was, when I tried to import database into the SSDT project, but this database already was in project, but was empty. I've just updated my project with Tools -> SQL server -> New schema comparsion. Source - database, target - project. Compare - update.
Hope it helps to someone
This error seems to be a 'catch-all' for errors that otherwise are not given a specific definition or tracing, especially those having to do with relatively external Xaml code.
In my particular case, there seemed to be an issue with the namespaces. My UserControl is in its own namespace (creatively named "UserControls"). My Pages are in their own namespace ("Pages"). I wanted to reference an enum definition in the Pages namespace from within my UserControl, so I simply added a using statement: using MySolution.Pages;. Trivial enough, and I didn't want to believe that this was the problem. But when I removed that using statement and simply created the enum in my UserControls namespace, voila, no more HRESULT error and also, as an added bonus, my dependency properties defined in the UserControl, which otherwise were mysteriously not showing up in the Xaml intellisense, suddenly were there and ready to use.
I suspect that underlying cause for this in my case was some sort of circular reference issue. And since there was no more specific error available to relate that information to me, it simply got shuffled into this HRESULT E_FAIL Com error.
I fixed this error by deleting the XAML file and add a new one from add new item. Then I pasted the XAML codes that was there in the old file.
This is an old question but in my case, none of the above solutions worked. I was trying to update the NuGet packages in Visual Studio 2017 but I was getting the following Exception.
update-package : Failed to add reference to 'System.Web.Razor'.
Error HRESULT E_FAIL has been returned from a call to a COM component.
In fact, other NuGet commands like restore-package were failing with similar exception message.
I discovered a few assemblies were missing under the packages directory so I deleted the packages directory and returned back to the Visual Studio 2017. When I opened the solution it asked me to restore the packages and after that, I was able to update the packages.
NOTE: Take a backup of package directory before deleting it.
I encountered this same error after installing VS2019 and trying to open a large solution (20+ projects), with both vcxproj and csproj projects, that target VS2015. The csproj all loaded fine, while the vcxproj all failed with the OP's error. Deleting the .vs folder did not work.
What did work was setting VC++'s "Fallback Location", under the "Browsing Database Fallback" settings.
Tools (menu)
-Options...
--Text Editor
---C/C++
---Advanced
----Browsing Database Fallback
-----Fallback Location
I set mine to D:\VC++\v16. Where I use v140 for VS2015 and v141 for VS2017. Also set "Always Use" and "Do not warn".
If anyone facing this issue, while adding reference in console/windows applications, follow the below steps
Open "Developer Command Prompt for VS 2017" as Admin
CD into "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PublicAssemblies"
Run "gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll"
Restart Visualstudio
Reference - https://developercommunity.visualstudio.com/t/add-a-reference-raise-error-error-hresult-e-fail-h/260196

Another knack on the "Dialogs must be user-initiated" Security Exception in Silverlight printing

I get the infamous "Dialogs must be user-initiated" Security Exception when I try to print some stuff in Silverlight. As you can see, the dialog is as user-initiated as can be:
John Papa couldn't help me much out neither, because I don't have any breakpoint set. Mr MSDN thinks it could also be that I'm just taking too long, but this is a demo application just as simple as can be.
Any ideas? I guess it's a Visual Studio quirk, maybe some extensions interfering, as things seems to work when I launch the application outside of it. I first thought maybe the Code Contracts are interfering with their IL weaving, but they are deactivated for this project.
Update: This is just a simple Silverlight application that runs locally from the file system. When I do "Start debugging", Visual Studio creates a hosting HTML file containing the Silverlight app in the Debug resp. Release folder of the project, launches the Internet Explorer with that HTML file and attaches the debugger to it.
Update 2: I also get the same error when I create a web project to host the Silverlight app and create a virtual directory for it on IIS.
I might also want to add that I don't have problems with printing in other Silverlight projects regardless of their hosting scenarios.
Update 3: I downloaded FireFox and it works, I don't get the error when I debug with it. So it seems to have to do with my IE8. I uploaded the solution:
http://dl.dropbox.com/u/10401470/Code/Demos/PrintingDemo.zip
I wonder if anyone can reproduce?
Anyone got an idea to which team I should file a bug report? Silverlight team? IE team? VS Debugger team?
I'm able to reproduce this. You have handled the Click twice, once in XAML another time in code. See your MainPage.xaml
<Button x:Name="PrintButton"
Content="Gotta print 'em!" Margin="8"
Click="PrintButton_Click" />
Don't feel bad about it. I did it last time through a misplaced Print inside a loop.
I've also experienced this strange behaviour. A standard button click event immediately invoking an OpenFileDialog. It would frequently generate the same error when being debugged but would eventually be coaxed in to working when the button is clicked several times.
However when built as a release (or perhaps simply by running the same Xap without a debugger attached to the browser) the problem would go away.
Try to remove
if(SightPaleceListBox.Items.Count > 0)
I had the same problem and found out that the reason was this following line:
cnvsMain.Children.Remove(PrintPagePlaceHolder);
cnvMain is on the page that the user pushed the Print button on (I was trying to remove it from that page in order to add it to the canvas that I was going to print).
My tip: try to comment rows one by one, until you find what row causes the problem. Than try to work around it.

adding/removing a file in VS2010 causes "WebDev.WebServer20.exe has stopped working" error

This is driving us crazy... In VS2010, MVC2 projects, not all projects.... both on a project that was upgraded from 2008/mvc1 and on a brand new project created within 2010/MVC2, we have the following behavior:
1) develop as normal..
2) hit F5 or CTRL-F5 to open up a browser
3) works great!
4) add a CSS file (or JS file or any file, or remove any file) in the project
5) immediately the dialog pops up "WebDev.WebServer20.exe has stopped working"
You have to close the program, and "F5" again - and all is right with the world...
Say we then modify an existing css file. No problem. But adding or removing one, immediate crash.
It seems like the development webserver is "locked on" to the project file and when it detects a change, it dies.
The Event Viewer is pretty unhelpful. The following is logged:
Faulting application WebDev.WebServer20.exe, version 10.0.30319.1, time stamp 0x4ba204ca, faulting module KERNEL32.dll, version 6.0.6001.18215, time stamp 0x49953395, exception code 0xe053534f, fault offset 0x000442eb, process id 0x%9, application start time 0x%10.
This is happening on all of our developer workstations, which include some with Windows Sever 2008, some with Windows XP, and some with Windows 7. All are running VS2010 Premium with ReSharper.
Also, the same thing happens on projects which target the 4.0 framework, only the error message referrs to WebDev.WebServer40.exe instead.
Google has revealed nothing. We've already tried "setting a static port" instead of a dynamic port - no help.
Please help if you can.
So, as it turns out, the problem was due to a certain use of MVCTurbine and StructureMap, but it seems likely that the problem would also occur with other IOC Containers, not just StructureMap.
The author of MVCTurbine has expressed that the fix will be in version 2.2 of that product.
In the meantime, one extra line of code in your Global.asax will solve this problem:
//VNEXT: after Turbine 2.2 we wont need this line anymore...
protected override void ShutdownContext() { CurrentContext = null; ServiceLocator = null; }
This article shows the particular use case we were addressing. The "normal plain vanilla" use of MVCTurbine and StructureMap would not have this problem.
Obviously, great thanks to Javier for being so responsive to help requests!

Resources