My Xamarin form apps was running like 5 minutes ago then all of sudden it stop working. The apps close instantly after it started.
Below shows message display at Visual studio output,
Assembly Loader probing location: 'System.Buffers'.
Could not load assembly 'System.Buffers' during startup registration.
This might be due to an invalid debug installation.
A common cause is to 'adb install' the app directly instead of doing from the IDE.
Things that I tried but failed to resolve the problem,
Reinstall System.Buffer from Nuget package.
Clean bin and obj folder of android
Unchecked use shared runtime at Android options
Clean solution and rebuild solution
Forum that I referred
https://forums.xamarin.com/discussion/115983/stuck-on-error-could-not-load-assembly-system-buffers-during-startup-registration
https://forums.xamarin.com/discussion/63584/android-could-not-load-assembly-xxx-during-startup-registration
https://bugzilla.xamarin.com/show_bug.cgi?id=44518
Can anyone helps me? Thanks in advance
I have found the solution from one of the forum.
Uninstall System.Buffer and install System.Memory using NuGet package to your project and its done. Hope it helps you.
I have solved this issue in little bit different manner. I have installed System.Memory from NuGet package manager without uninstalling System.Buffer. Then only error is gone. If I am uninstalling System.Buffer I still face the same issue.
I know that it is a common problem but I really have tried all the solutions and nothing helped me so far.
I am developing a .net site for more than two month...
Yesterday I have faced with this error:
'Could not load file or assembly 'myDllName' or one of its
dependencies. The process cannot access the file because it is being
used by another process. (Exception from HRESULT: 0x80070020)'.
And I can't find any solution for this.
Anyone has an idea??
I have already:
close the VS and re-opening.
reset the computer.
clean the project and the solution (from the vs)
clean manually all the bin folders of the project.
clean asp.net temporary files(including 64 and 86 version).
change the compatibility of the default application pool in the
IIS manager to 86.
In this case, I would open a blank solution and slowly add the DLLs that you care about to get the smallest version of this problem possible.
In my case, when I encountered this error, the key part of the error message was "or one of its dependencies." One of my DLLs was dependent on another DLL I didn't know about or I would have included it.
I am using Visual Studio 2015 with ASP .Net MVC 6 on Windows 10. As far as I can tell everything's up to date, but I haven't changed anything recently that I know of. In the last couple of days Visual Studio has stopped letting me compare the current version of an *.cshtml file to see what changes I've made. It works for every other type of file I've tried, only these ones are being a problem.
I am getting the error message "Failed to start the configured compare tool." I've seen a couple of other posts (like this one: Visual Studio 2015 using Git unable to compare files and Microsoft Git Provider and Visual Studio 2012 failed to start the configured compare tool) but they seem to be talking about a more general cannot diff at all problem, which isn't what I'm seeing. It's almost as if git (or VS?) has decided to pick just this one file type to not like.
I have tried creating a new ASP .Net project with a new git repository and it sees the same problem, and the problem goes away if I rename the .cshtml file to give it a different extension. I've had a look in the .gitattributes file but can't see anything, though if I'm honest I don't really understand how git works beyond the basic 'this is how you drive it around when it works'. I've also tried removing and reinstalling everything git related I can find on my PC with no joy.
Anyone have any ideas on what I could have broken?
Update: I've just found this https://github.com/aspnet/Tooling/issues/293 which suggests that it might be related to an ASP .Net Update. Guess I'll probably have to wait and see.
Clearing the MEF cache appears to resolve this also. Close the IDE and delete the contents of this directory:
%LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache
Clear MEF Component Cache (Open VSIX Gallery) will probably do the trick as well.
Likely related to https://stackoverflow.com/a/32376450/1154135
This turned out to be related to a problem with the new ASP .Net tooling. They've apparently got a fix to be rolled out, but until then there is a workaround:
In the options panel, go to Options->Text Editor->HTML->Advanced
Set Identity Helpful Extensions to False
This is as per https://github.com/aspnet/Tooling/issues/293#issuecomment-161382206
Check your .gitignore file for references to .cshtml files. Dollars to doughnuts that something like *.cshtml is in that specific repo. Can you run the diff in git outside VS?
I feel guilty asking a question like this around here, but I'm at a loss and would appreciate some help.
A proof-of-concept like web application was built on one PC and put up on a repo to download on another PC at a different location. There was originally an auto-build feature set up where Azure would build and publish automatically on check-in, but that was removed. Things were working on both ends until one side included a bulk of excluded changes. Now I'm seeing the following error:
The "Microsoft.CodeAnalysis.BuildTasks.Csc" task could not be
loaded from the assembly
...\packages\Microsoft.Net.Compilers.1.0.0\build..\tools\Microsoft.Build.Tasks.CodeAnalysis.dll.
Could not load file or assembly
'file:///...\packages\Microsoft.Net.Compilers.1.0.0\tools\Microsoft.Build.Tasks.CodeAnalysis.dll'
or one of its dependencies. The system cannot find the file specified.
Confirm that the declaration is correct, that the assembly
and all its dependencies are available, and that the task contains a
public class that implements Microsoft.Build.Framework.ITask.
Does anyone have any suggestions on where to begin looking for the issue?
It turns out that NuGet packages were committed to the repository and breaking everything. Deleting the project\project\packages directory from the repo solved all build problems since NuGet fetches the packages automatically on build.
I got this error when I created a new branch for my project.
It drove me crazy for an hour. I tried most of the suggestions over the internet including the accepted answer to this question.
I then closed the project, opened it again, cleaned it and the error is gone. So this means this could be cache issue.
Anyways, just wanted to share.
I too tried the top answer with no luck so deleted the contents of my bin and packages dir, closed and re-opened VS and everything fine now.
I have tried all solutions described before, but none worked.
What solved it for me, was to update the Microsoft.Net.Compilers from the NuGet Package Manager
Right-click on your solution.
Go to Manage Nuget Packages.
Search for Microsoft.Net.Compilers.
Install or update on dependent projects as necessary.
Re-build, clean solution and restart Visual Studio worked for me.
Deleting the package and cleaning the solution solved it for me.
Deleting these three directories solves the problem.
/packages
/bin
/obj
NOTE: delete both /bin and /obj from all projects included in the solution (including Test projects).
Problem hides on TFS, you need to remove folder TestProject...\packages from TFS, check in, delete it from your local dir and build again. Worked!
Use the below step:
1) Delete the package folder.
2) close the visual studio.
3) open the project and rebuild the project.
I delete all from packages folder and rebuild solution. It's worked for me.
In my case: this works for me.
It turns out my teammate had already started looking into Windows 10 development and had Microsoft Build Tools 2015 installed on his machine.
I installed the software from https://www.microsoft.com/en-us/download/details.aspx?id=48159 and the problem was solved.
In my case, the solution was:
Use Windows Explorer and navigate to the offending path:
C:\MyApplication\Code\Main\ABCProject\ABCProject.UI\Bin
Right click on bin folder > select properties > Uncheck ReadOnly.
In my case, the solution was:
Right Click on Solution.
Go to Manage Nuget Packages for this Solution.
Search for Microsoft.CodeDom.Providers.DotNetCompilerPlatform.
Uninstall the searched Package.
Restart the Visual Studio.
I just tried this on a clean install of a Windows 10 machine and the issue for me ended up being that I didn't have the .NET 3.5 framework installed. This stackoverflow question helps explain why.
Cannot build WIX project on windows 10
Right Click on Solution.
Go to Manage Nuget Packages for this Solution.
Search forMicrosoft.Net.Compilers on Browse Section.
Deleting the bin folder worked for me
In vs2017 community there appeared a new item in the "build" menu. It disappeared after I used it and was called something like "Optimise project build packages". I clicked it and it fixed everything, just restart etc. I did it on two machines.
What it did was removed Microsoft.net.compilers 2.10.0 and replaced with Microsoft.CodeDom.Providers.DotNetCompilerPlatform 2.0.1
So there you go - more automagic...
My project was built with .Net Core 2.2 but I had .Net core 3.0 preview installed. I uninstalled .Net Core 3.0 from my system and went through all my class libraries, removing Microsoft.Net.Compilers 3.0, then rebuilt and it worked.
I moved my solution from one drive to another, and one of the files could not be copied because "in used", for which I click ignored, producing the error described in this post. Copying the missing file manually fixed it.
file: Microsoft.Build.Tasks.CodeAnalysis.dll
Destination directory: packages\Microsoft.Net.Compilers.2.1.0\tools
For me I was trying to open a MVC5 project in VS 2013 and I was getting this error, Opened it in VS 2017 and up it worked just fine.
All of the sudden, I'm no longer able to build a Solution without getting an error in VS 2010. A minute ago I was able to build, and now I can't.
The error is:
Unable to load referenced library 'C:\Program Files\Reference
Assemblies\Microsoft\Framework.NETFramework\v4.0\System.DirectoryServices.dll':
System Error &H8013110e&
I've checked and the .dll is there.
I've re-booted and grabbed the latest version from Team Foundation Server.
Any ideas?
This post on MSDN indicates that this error message represents a BadImageFormatException. That exception, combined with the steps you have already taken, makes me think that maybe your install of .NET has become corrupted. I had a similar issue a while back (while using a VM) and I had to repair the .NET Framework on my VM using the .NET Framework Cleanup Tool to finally resolve the issue.
If you check the comment on the accepted answer to this question, I posted the steps I took when using the .NET cleanup tool.
I re-installed VS 2010, and the error no longer appears.