I'm working on a project while the project is working fine.
But after re-installed the Visual Studio my project is not loading.
Giving this error:
D:\UOSGC\Final\Banquet_Events_System\UI\UI.csproj :
error : Could not load file or assembly 'Microsoft.VisualStudio.Web, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The file or directory is corrupted and unreadable. (Exception from HRESULT: 0x80070570)
Error screenshot is:
My operating system is Windows 10 Professional and I'm using Visual Studio 2015.
The file or directory is corrupted and unreadable
Any help will be appreciated!
There can be multiple steps / things you have to do for solving this issue:
Step 1: First Check C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config
It looks to add a line under:
<system.web> (not the section under <location allowOverride="true">)
<compilation>
<assemblies>
.....
<add assembly="Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
.....
</assemblies>
There was already a <remove ... /> for this assembly at the top of that section for mine, but the add was near the bottom. Just comment this entry, and it should start working. Or if you are unsure about removing it for all websites, you could add the same line in your website web.config, with remove instead of add.
Step 2: (if you are using VS 2019) Reinstall "AspNetDiagnosticPack.msi" can solve the problem. There will be a file in the package installation folder of the VS 2019 Installation. (The checkbox for "not delete" install packages was activated*).
If you don't have the packages, that maybe a offline installation helps.
In my case the folder was named: "Microsoft.VisualStudio.AspNetDiagnosticPack.Msi,version=16.0.12276.43788".
Richt click on "AspNetDiagnosticPack" and select "repair".
Step 3: You need to download this MSI And execute it and select repair.
Finally, if any of above steps not solved the issue you need to download and install this new Visual Studio release in which this issue has been resolved.
This kind of error may occur when you install visual studio newly and try to open existing project from source control or local machine. I faced same issue couple of time, I used Clean MEF component cache to fix this issue.
Clear MEF component extension in visual studio clears the MEF cache on disk and lets Visual Studio rebuild it. The reason for clearing the MEF cache is that it can become corrupted. This usually happens when installing or updating extensions or other Visual Studio components. If still error persist then check compatibility of your project like, x64/x86 otherwise keep as any CPU.
Steps:
Install Clear MEF component cache extension from market place or from visual studio. Click Here; MEF component
After installation go to Tools -> Clear MEF component cache and press OK.
Did you try opening the project under Administrator mode.
Since you can't create a new web project you most certainly are having an issue with visual studios. You are certainly best off to completely uninstall and reinstall Visual Studio. If the problem persists it may be that Microsoft.VisualStudio.Web is corrupted in the GAC.
If you can replace it with a known good copy that would be worth a try. I'm not sure what uninstalling and installing all versions of the .NET framework would have on corrupted files in the GAC, but it may be worth a try since you don't know for certain what files are bad and if one is bad you may have others.
Good Luck!
Update: GAC is Global Assembly Cache. It's part of windows.
Here is a stackoverflow question regarding updating an assembly in the GAC.
I am guessing that you ended up corrupting one of the dll s provided by .net. this is merely related to your project rather it would be a problem when you try to create new solution also. I would recommend you to follow the steps described here
A few things that you can try:
1.Clear your temporary asp.net files
2.Stop IIS if you are running IIS.
3.Delete all the files in this folder:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary
ASP.NET Files
Try to open the csproj file in notepad++;
Post the contents for me if you can. Chances are that one if the GUIDS is not being recognised as a valid type
If you have another similar csproj file backed up, try to open it in visual studio. If it opens, edit this csproj file in notepad++ or a comparetool. Specifically look at your references section. Play around with removing some sections.
I don't think what you are experiencing has to do with Visual Studio. It's a file system issue. Is the D drive a USB drive?
The drive is corrupted. You need to fix it using a utility like chkdsk
:
chkdsk /f d:
If that doesn't fix the issue. Copy the solution to another drive and try again.
Just like the message says, it's corrupted.
The only thing that you probably can do is to copy all of your code in a new project.
else you could try to delete the corupted file and recreate it(check this link for more info)
VS corrupted .sln file?
This probably happened because you shut your computer down the wrong way.
I'm hoping for you that it'll work out.
You have files that are corrupt, just like the error says. Follow these steps, in order, to fix the issue:
Hopefuily one of these steps will work.
If you have 2 or more VS installed, and u uninstall one of the version, it might have accidentally remove the dependencies.
You can try repair VS2015 and see if it helps.
If you can open this solution on another computer, then the problem is either: (a) your computer has some hardware issues, or (b) your version of visual studio is corrupted. Maybe you changed something that you didn't expect?
Anyway, your best bet is probably to just uninstall visual studio and reinstall visual studio. Probably not the answer you want to hear but sometimes nuking and starting over is the only way to go. You should only do this after determining if the solution directory is not the issue.
Before you go to the extreme, just simply try copying the folder where the solution is located to another place on disk and opening the project again. Make sure you run the project as an administrator if the project is a web project.
I would copy the folder from your drive to a USB drive and then try another machine that has visual studio installed. If that is your only machine I am willing to assist. Feel free to PM me and I can try opening your solution on my machine and let you know if there's something wrong with your solution file or project file.
User contributions licensed under CC BY-SA 3.0