Microsoft Visual Studio not opening files - c#

Whenever I try opening a .cs file with Visual Studio, I get this error :
Expected 1 export(s) with contract name "Microsoft.VisualStudio.Utilities.IContentTypeRegistryService" but found 0 after
applying applicable constraints.
Visual Studio had been working working fine for me, then all of a sudden this started happening. I tried deleting the cache and even uninstalling the program altogether, but the error persists. I checked online everywhere, but nobody seems to have had this issue before. Here is a picture.

The best SO link I've found gives heaps of different options - see here - I would suggest running a repair on the install and try things other than clearing the cache.
The referenced link indicates a bunch of different conditions that affect how you resolve the issue. For example are you running express/community edition or professional etc?
Without knowing what causes the cache to get corrupted I can't answer exactly how to fix it.

Related

Error The file 'Resources/LaunchScreen.xib' conflicts with 'Resources/LaunchScreen.xib'. ios xamarin

I am working with a Xamarin application where I have already built both IOS and Android applications. I am using Visual Studio 2019 for the development and use iPhoneSimulator to test the application, after connecting to the mac device. Suddenly I am getting an error as preceding.
Error The file 'Resources/LaunchScreen.xib' conflicts with 'Resources/LaunchScreen.xib'.
Anyone ever faced this issue before, I am 100% sure that it is not related to any recent code changes, thus providing codes wouldn't help here.
As I was sure that the issue is not related to the recent code changes. I did the preceding things first.
Clean the solution and rebuild
Delete the bin and obj folder manually and then rebuild
But I was getting the error again, the only thing which worked for me is restarting the visual studio and open the project again. Hope it helps.
I get this error a lot, or various other errors that seem to be related with items being duplicated. The easiest fix is to just disconnect from the Mac and reconnect. This is assuming that you are developing on a PC and pairing to a Mac. I suggested to the developers that they simply include disconnecting and reconnecting as part of the build process until they can figure out the actual cause.
If you are on the actual Mac, the process that Sibeesh Venu describes may be what occurs each time Xamarin pairs with the Mac.
The developers asked me, and others that have reported this issue, to turn on diagnostic debugging so that they can be provided with a log for when it happens. I did this, and noticed that it occurs less frequently for me. This makes me suspect that it's related to timing when files are processed.
https://github.com/xamarin/xamarin-macios/issues/6770#issuecomment-575310911
I encountered this same issue after after doing a merge in source control. It turns out that there was a duplicate instance of the .xib registration in my iOS.csproj file. In other words, there were duplicate lines that looked like this:
<InterfaceDefinition Include="Resources/LaunchScreen.xib.xib" />
Once I removed the duplicates, everything worked perfectly.

Visual Studio 2015: error building solution

I have a .Net C# solution that can be built in Visual Studio 2013 without any problem. It reference several dll's, one of them done it by me.
The problem starts when I have tried to build it in Visual Studio 2015, without doing any change (is exactly the same soultion and code). The next error (between 600 more because of this one) is shown:
Error metada file *.dll could not be open: invalid public key
I have searched a lot, but I can not find a solution for it. I would appreciate any help.
**** EDITED WITH MORE INFO ****
I use ConfuserEX. If I use the dll before ofuscate it, it works. The dll is not signed, so ofuscate it should not be a problem. Any ideas? (I have to ofuscate it and it have works for a long time and still works with VS2013)
Old question, but for those that look here, the issue is documented as ConfuserEx issue #450:
https://github.com/yck1509/ConfuserEx/issues/450
A fix was added to the follow-on project neo-ConfuserEx, but has not been published in a release of the project (as of this writing).
https://github.com/XenocodeRCE/neo-ConfuserEx
The description of the fix is: Fix issue yck1509#450 for VS2015 and VS2017 build error when resource protection enabled (BUG: "CS0009 ... -- Invalid public key."). Which suggests you can turn off resource protection as a work-around.

Xamarin IDE Access to the Path is denied

I'm porting over a Visual Studio C# solution with many projects and creating a new solution in the Xamarin IDE - all on windows.
I am porting / re-creating 1 project at a time and then compiling. I can compile each project individually but and then I can compile the solution (with some errors).
The problem arises if I try a Rebuild All, then it shows the error:
'Access to the path "[my build path\some.dll]" is denied.'
I have full admin rights and, as I mentioned, I originally could build the dll's so it's not an access issue.
If I try to actually delete the dll's in question, I can't - windows denies me.
If I close Xamarin, I can then delete the file manually. So, I assume, Xamarin still has a 'lock' on the file which won't allow it to be deleted.
Has anyone else seen this and if so, how did you get around it?
If this is a bug, then this makes this nearly unusable.
I just started with Xamarin in Windows as well and am having this problem. A quick fix I found it to switch from Debug over to Release; but this disables your debug output. Closing and reopening Xamarin has also relieved the issue for a few more debug builds.
I have found no rhyme or reason why this is occurring, seems to be at random.
Check the read-only property of the dll on that path, make sure it is not checked. I had the same issue, After unchecking the read-only property, the issue resolved.
Remove all cache in this file C:\Users{user}.nuget\packages And update xamarin.forms

Unable to automatically step into the server. The debugger failed to stop in the server process

I receive the following error when attempting to Step Into a process using F11 in Visual Studio 2008 Team System:
"Unable to automatically step into the server. The debugger failed to stop in the server process."
I have searched pretty long and hard on the internet and the most relevant message I found was http://msdn.microsoft.com/en-us/library/65004e38%28v=VS.90%29.aspx. Unfortunately, this did not help. All signs are pointing that my ASP.NET setup is incorrect, but it's the IIS environment that ships with VS2008 Team System so I didn't make any figuration changes.
The answer to this question, which sounds like it might have fixed my solution is no longer an active link: Unable to automatically step into the server when debugging WCF. Does anybody know how I can jump into and fix this problem?
This took me 3 days and no less than 5 people looking at the problem to solve; although I'd like to report the exact problem I'm still left to speculate. However, I am no longer getting this error when I do the following:
I opened the .cs file of the base class my service derived from within my Testing solution. I set a break-point in the constructor of this base class. Because the base class wasn't within the solution of either my web service nor my test solution (it was simply referenced), VS2008 was unable to break into this .cs file.
The solution was rather moronic. I opened the base class.cs file within my Testing solution (the file only, not the solution). I set a break-point in the constructor class, and I was then able to step-into all other files from there. Once I was able to successfully set a break-point and stop the debugger in the base class within my actual Test solution, I was able to continue debugging as I would normally expect.
My only conclusion to the root cause of this problem is that VS2008 is retarded. I'm sorry it's not much of an answer, but this is how I was able to resolve the issue which sunk over 30 hours of time.
This could be because the debug not reaching to your break point there may be some error occurring before it.Try add break point in the base class constructor.
I know this is an old question, but I encountered a similar issue and the problem was that I was in Release mode rather than Debug mode. Changing to Debug mode solved the problem. I'm using VS 2010.
this problem can occur if you have another solution opened and running (another instance of visual studio).
I got this error once when I had the wrong project set as the startup project in the solution.
This same thing happened when I had the service open in a browser. I closed it out and it fixed the issue.
Guessing you have it open multiple times. (basically repeating what Avicena00 said)
I got this error when trying to import a file that was too big. I had to increase the maxAllowedContentLength value in my requestLimits area in my web.config to fix it.
As stated this is an old problem, but I ran into it running later versions of Visual Studio, and have not seen the solution that I found listed. This problem in my experience happened when the service was using a lower version of .Net (in my case 3.0 vs 4.5). Changing the .Net version int he project properties to 4.5 (which matched the project referencing the service), solved my problem.
This worked for me: Tool > Options > Debugging > Use Managed Compatibility Mode
Visual Studio 2018 Options
In my case the problem was that I had open the same project and its copy (in different directory) in two Visual Studio instances. Solution than in final was simple as closing all IIS instances of Web projects and closing all instances of Visual studio. After opening just one project at a time debugging started to work like a charm.
I get this error when I debugged one and another solution.
The answer is very simple
Click on the solution->Properties->Multiple startup projects
Then select projects and click f11.

***.tmp is not a valid win32 resource file. How to resolve this weird bug on Visual Studio?

I use Visual Studio 2008 SP1.
I'm experiencing a boring bug, that sometimes break my compilation processes with something like:
Error 4 'C:\dev(...)\obj\Debug\CSC4B.tmp' is not a valid Win32 resource file (...)
This file doesn't even is shown in the \Debug folder. The only way I can solve this (temporarily) is to restart the machine. It is happening more frequently now.
Do you know how to resolve this issue?
NOTE:
I've searched in many places for resolving this bug. Most places mention something with icons, but I have set no icons to projects in this solution.
The problem was really weird. And the fault was of GDI++, an application that changes the way Windows renders text. After closing this processes, everything is just working fine (except the text rendering).

Categories