Unable to write manifest, System.OutOfMemoryException - c#

When I try to compile my program on Visual Studio 2010 I get this error:
"Unable to write manifest
'obj\x86\Debug\WindowsApplication3.exe.manifest'. Exception of type
'System.OutOfMemoryException' was thrown."
It seems that this error occurs quite randomly. I got it for the first time some weeks ago and I had to restore Windows to solve the problem. Then I got the same error this morning and this time I had to delete the Debug folder. Finally, two hours later, same error again and none of the two previous solutions are working.

Related

Weird error: Microsoft (R) Visual C# Compiler version 3.5.0-dev-20359-01 (8da8ba0c)

I have a Unity 2020.3.22f1 project that was perfectly working at first. However, this error occured after editing and saving one of my scripts in Visual Studio (with no apparent bug in it):
I don't give details about my script or the project, because it doesn't seem to relate to the project itself or what I did, as the error appears now in all my Unity projects! I first tried to delete the script that triggered the bug, then I deleted the whole project. I even uninstalled/reinstalled Unity (different versions), Visual Studio and Unity Hub. But it seems that now I'm stuck with this forever.
Does anyone have a single clue about this? I saw one or two people having the same problem on the web, and with no other solution than formatting the hard drive. As I'm not working on my personal computer, I can't do that...I mean, there must be a rational explanation to this bug!!
I downloaded the latest version of Unity (2021.2.2f1), launched a brand new project, and the error now turned to: "The specified path can't be found" (rough translation from french), without more precision...still no idea what it means.
Ok, I found a solution from here: Unity 2019.3.0a7: Microsoft Visual C# Compiler Errors
I don't know how it's related, but it is suggested that the error can be triggered by uninstalling Anaconda and Python (which I happened to do recently), which leads to remaining artifacts in the Windows registry. I then deleted the following item in the Windows registry:
Computer\HKEY_CURRENT_USER\Software\Microsoft\Command
Processor\AutoRun
and restarted Unity. Now it works!
Got the same issue, the problem is in an incomplete path
Command line is : "C:\Program Files\Unity\Hub\Editor\2022.1.0a13\Editor\Data\Tools\netcorerun\netcorerun.exe" "C:/Program Files/Unity/Hub/Editor/2022.1.0a13/Editor/Data/Tools/ScriptUpdater/ApiUpdater.MovedFromExtractor.exe" "Library\Bee\artifacts\mvdfrm\UnityEngine.LocalizationModule.dll_9374ECE80455BEFE.mvfrm" "C:\Program Files\Unity\Hub\Editor\2022.1.0a13\Editor\Data\Managed\UnityEngine\UnityEngine.LocalizationModule.dll"
Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\damos\project name is missing here\Library\Bee\artifacts\mvdfrm\UnityEngine.LocalizationModule.dll_9374ECE80455BEFE.mvfrm'.
This path is missing the project name between damos ans library

When trying to "Commit all and Sync" an error pops up: "Git failed with a fatal error."

I worked for a while on a WebApp (c#, .NET framework 4.5) and wanted it to upload to git(Commit all and sync). Mind you, I've done this a few times already, and this is the first time this error pops up.
This is the error:
Git failed with a fatal error.
warning: LF will be replaced by CRLF in Test2/packages/bootstrap.3.4.1/content/Content/bootstrap-theme.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Test2/packages/bootstrap.3.4.1/content/Content/bootstrap-theme.min.css.
Is there any workaround or a quick fix?
EDIT: Visual Studio 2017 - Git failed with a fatal error I've seen this thread. This does not solve my problem it is different.
EDIT2: I probably found the reason why it may have occured: I linked a database to this app and that may have caused this.

Empty project error - Xaml Internal Error error WMC9999: Object reference not set to an instance of an object

I spent more than 10 days searching for a solution which I tried them all.
I have this error message when I add those libraries to my project
Libraries:
- PresentationCore.dll
- PresentationFramework.dll
- System.xaml.dll
- WindowsBase.dll
Error Message:
In Error List:
Object reference not set to an instance of an object. App1 C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\WindowsXaml\v15.0\8.2\Microsoft.Windows.UI.Xaml.Common.targets 266
In output:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\WindowsXaml\v15.0\8.2\Microsoft.Windows.UI.Xaml.Common.targets(266,5): Xaml Internal Error error WMC9999: Object reference not set to an instance of an object.
The Error in this Line (from file name Microsoft.Windows.UI.Xaml.Common.targets)
<CompileXaml
LanguageSourceExtension="$(DefaultLanguageSourceExtension)"
Language="$(Language)"
RootNamespace="$(RootNamespace)"
XamlPages="#(Page)"
XamlApplications="#(ApplicationDefinition)"
PriIndexName="$(PriIndexName)"
ProjectName="$(MsBuildProjectName)"
IsPass1="True"
CodeGenerationControlFlags="$(XamlCodeGenerationControlFlags)"
ProjectPath="$(MSBuildProjectFullPath)"
CIncludeDirectories="$(XamlCppIncludeDirectories)"
OutputPath="$(XamlGeneratedOutputPath)"
OutputType="$(OutputType)"
ReferenceAssemblyPaths="#(ReferenceAssemblyPaths)"
ReferenceAssemblies="#(ReferencePath)"
ForceSharedStateShutdown="False"
CompileMode="RealBuildPass1"
XAMLFingerprint="$(XAMLFingerprint)"
FingerprintIgnorePaths="$(XAMLFingerprintIgnorePaths)"
VCInstallDir="$(VCInstallDir)"
SavedStateFile="$(XamlSavedStateFilePath)"
SuppressWarnings="$(SuppressXamlWarnings)"
TargetPlatformMinVersion="$(TargetPlatformMinVersion)"
WindowsSdkPath="$(WindowsSdkPath)"
>
I think the error from the libraries so I tired old versions from framework libraries but the same error appears.
I thought I have error in my code. So, I created an empty project. added library. Build, and same error again, So the problem is not from my code since I have no code in empty project.
My search on the internet suggests to updat both Visual studio and windows to the latest version. (I did that)
Error in my code. (it's empty new project)
So I end up with empty hands with most annoying error and no solution worked out for me for the last 10 days.
Visual Studio Community 2017
Libraries from framework V.4.6.2
PLEASE HELP
THANK YOU
Since no one answered my question and i couldn't find any solution on the internet. I found out the solution which i will post here in case some one need it in the future.
the WindowsBase.dll does not support WPF
that is why it required the xaml which will never work.
so if you need delegate.begininvoke you need to find another solution since it needs WindowsBase.dll
my friend suggested to use worker which i am tring ti do now

TFS 2013 Throws Lib2GitSharp Error During Build/Deploy (Intermittent)

For a while now, I have been having an issue with Team Foundation Server build/deploy process throwing the following error intermittently:
Unhandled Exception: System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at LibGit2Sharp.Core.NativeMethods.git_threads_init()
at LibGit2Sharp.Core.NativeMethods.LibraryLifetimeObject..ctor()
at LibGit2Sharp.Core.NativeMethods..cctor()
--- End of inner exception stack trace ---
at LibGit2Sharp.Core.NativeMethods.RemoveHandle()
at LibGit2Sharp.Core.NativeMethods.LibraryLifetimeObject.Finalize()
Exception Message: MSBuild error 255 has ended this build. You can find more specific information about the cause of this error in above messages. (type BuildProcessTerminateException) Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
This problem is very intermittent and it can be bypassed by simply retrying the build. Has anyone else run into this? Any solutions?
I know it is a little bit late for answer but it might help someone else
answer by Buck Hodges
We have now gotten to the bottom of this issue after debugging it with Manoj and customer support. It affected gated checkin of continuous delivery of Azure deployments as part of the build process when using the Azure SDK 2.5 or older. The workaround is to add /p:GenerateBuildInfoConfigFile=false to the msbuild arguments in your build definition. We are working on updating the build VM in production, but that will take 24-48 hours to propagate to all build pools.
You might want to read more in context here
https://social.msdn.microsoft.com/Forums/en-US/5a0d1950-1367-41a6-9171-676a0d0e93c1/tfs-online-getted-checkin-build-failures-vs-online-tfs-online-team-need-to-look-into-it?forum=TFService
Alternative solution based on comments
If you have VS installed on your build server, make sure you have opened it and licensed it. by #Phill
Strangely enough for me, I was getting the same error in the build logs:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\BuildInfo\Microsoft.VisualStudio.ReleaseManagement.BuildInfo.targets (147): The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.
Unhandled Exception: System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
I was able to simply RETRY the build, and it did not fail on the second try. So for me it was a transitory build issue.
Although late to the party, experienced this error recently and while the solution marked as the answer worked for that build, the error was fixed (and the switch removed) when Visual Studio 2012 was upgraded to Visual Studio 2015 Update 3 on the build server which was running TFS 2015 Update 3.
I hit this after I had upgraded my TFS 2013 XAML build machine to TFS 2015.
I had also changed the user that TFS 2015 XAML build used to run the build (service.
The Fix:
I had to log into the TFS 2015 XAML build machine as that new user and launch VS (I was using VS2013).
It ran through it's first time launch questions and setup.
I still saw the Lib2GitSharp Error issue sometimes after that.
Then I also logged VS (on the TFS 2015 XAML build machine) into a valid VS account.
I have not seen the Lib2GitSharp Error since and I never used the /p:GenerateBuildInfoConfigFile=false option.
I resolved this error by adding the build account to the local administrators group on the build machine.

Request.ServerVariables not working in VS 2013

I have been using Visual Studio 2010 for the last few years but today we were required to update to 2013. I went to open my existing project, which worked without any issues previously but now throws the following error:
A first chance exception of type 'System.ArgumentOutOfRangeException'
occurred in mscorlib.dll
Additional information: startIndex cannot be larger than length of string.
This error is triggered at this line of code:
string logon_user = Request.ServerVariables["LOGON_USER"].Substring(7);
Any ideas on how to resolve this? After some research I found a simple workaround by using this line instead:
string logon_user = System.Security.Principal.WindowsIdentity.GetCurrent().Name.Substring(7);
But I am more interested in finding out the reason why Request.ServerVariables doesn't work anymore. I am using this in tons of other projects and would like to see if it's something I can resolve without changing the line in every project.
My guess is that you're running this locally, correct? ON your development machine? If that's the case, then sometimes Visual Studio will reset Anonymous authentication to on, and if it 's on, then the ServerVariables will return null.
See this answer:
IIS express applicationhost.config security is reset every time a solutions is opened in VS2012

Categories