After restoring .exe file from Avira Security Isolation, lnk1104 happens and cannot delete .exe file - c++

I built a C++ visual studio project for homework3 prob2 so I name it "HW3 Q2 cmp".
But I make a mistake about vector size in the beginning. But after a few failures. The avira security somehow put my .exe file to isolation. I looked into it and restore it from isolation.
But then the nightmare error LNK1104 happened.
Severity Code Description Project File Line Suppression State
Error LNK1104 cannot open file 'C:\Users\Pun Wing Hon\Desktop\Cityu\Year Three\EE2331 data struct\HW3 Q2 cmp\x64\Debug\HW3 Q2 cmp.exe' HW3 Q2 cmp C:\Users\Pun Wing Hon\Desktop\Cityu\Year Three\EE2331 data struct\HW3 Q2 cmp\HW3 Q2 cmp\LINK 1
Then I use GDB online to fix the code. After fixing the code and tested it in another vs project. Then I fix the problems in the origin "HW3 Q2 cmp" until "No issues found". But the LNK1104 still there.
What is more scary is when I want to delete the project manually(delete the whole project file in window explorer). It cannot delete the .exe file and asked for administrator while I myself is the administrator of the computer.
I checked the task manager and no thread is running. The properties show that I, or all users should have the complete control of the file and can delete the file.
I changed my account from microsoft to computer But still not work.

Related

Visual Studio C++ 2022 build fails without error message on Mac network share

Ever since I updated Visual Studio 2022 from 17.1 to 17.2, I have been having a problem with my C++ project build failing without emitting an error message in the IDE Output window, no matter the diagnostic level selected in the Tools->Options->Projects and Solutions->Build Options menu.
I have tried:
Reinstalling Visual Studio 2022
Deleting .vs folders(s)
Deleting the x64 folder
These are all suggested in answers to similar questions from several years ago that I have read here.
It definitely seems to have something to do with being on a network share from my Mac. I cloned my repository locally and the problem went away. Meanwhile, I cloned my repository to a different directory on the network share, and it continued to fail in the new directory.
I have discovered an error message buried in C:\Users\<user>\AppData\Local\Temp in a file named MSBuild_pid-<guid>.failure.txt. It appears to be correlated to the failure. Here is the error message:
UNHANDLED EXCEPTIONS FROM PROCESS 624:
=====================
6/20/2022 8:49:39 AM
Microsoft.Build.Framework.LoggerException: Failed to write to log file "Y:\<filepath>.log". IO operation will not work. Most likely the file will become too long or the handle was not opened to support synchronous IO operations.
at Microsoft.Build.Logging.FileLogger.Write(String text)
at Microsoft.Build.BackEnd.Logging.ParallelConsoleLogger.WriteMessageAligned(String message, Boolean prefixAlreadyWritten, Int32 prefixAdjustment)
at Microsoft.Build.BackEnd.Logging.ParallelConsoleLogger.ErrorHandler(Object sender, BuildErrorEventArgs e)
at Microsoft.Build.Framework.BuildErrorEventHandler.Invoke(Object sender, BuildErrorEventArgs e)
at Microsoft.Build.Utilities.MuxLogger.SubmissionRecord.RaiseErrorEvent(Object sender, BuildErrorEventArgs buildEvent)
at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseErrorEvent(Object sender, BuildErrorEventArgs buildEvent)
at Microsoft.Build.BackEnd.Logging.LoggingService.RouteBuildEvent(KeyValuePair`2 nodeEvent)
at Microsoft.Build.BackEnd.Logging.LoggingService.RouteBuildEvent(Object loggingEvent)
at Microsoft.Build.BackEnd.Logging.LoggingService.LoggingEventProcessor(Object loggingEvent)
===================
This is similar to a question I posed a couple of weeks ago, but since the nature of the question is now more focused and has an apparent error message, I deleted that question and am reposting this issue as a new question for visibility and to avoid confusion.
[EDIT]
I decided to go fish out the actual log file in the message above. It turns out Visual Studio is not having any trouble writing to it. And it terminates in another error message:
RGPLua.cpp
RGPLuaConnector.cpp
RGPLuaConnectorBase.cpp
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\include\type_traits(59,92): fatal error C1001: Internal compiler error.
It is unclear to me which message is the cause and which is the effect. However, after running it several times it is worth noting that the error and file location given in the log file is different each time while the message in the MSBuild_pid file is always the same.

How do I fix a 'cannot open source file' error on MS Visual Studio 2022

Forgive me if I leave out important information, I'm a brand new programmer, and this is my first time using Stack Overflow.
I just downloaded MS Visual Studio, and was testing it by making a basic Console App that outputs "Hello world", but when I tried to run the program, it gave me a message that said "There were build errors. Would you like to continue and run the last successful build?" Then, when I pressed yes I got 478 errors, nearly all of which were "E1696 cannot open source file "filename"", or, "E0282 global source has no "filename"." Is there anyone who has encountered a similar problem, and if so, do you know what is causing it / how to fix it?

Why doesn't the c++ file run in visual studio

So I tried making a basic game on the console using screen buffers, I was able to create it and make a square move in the canvas, but for my next project I looked up a website with the ASCII characters and pasted a couple into a comment at the end of the c++ file, when I ran the file visual studio prompted:
I clicked yes and it didn't run anymore.
Also I recently have installed an extension for visual studio (before it didn't run, the extension works fine but I don't know if the extension may have caused this as I didn't tried running it with the extension downloaded and applied), when I open visual studio and open a file it says:
The last record in the ActivityLog xml file, has a type of error and it's description is:
Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name "Microsoft.VisualStudio.CppSvc.Internal.CodeAnalysis.ICodeAnalysisService" but found 0 after applying applicable constraints.
at Microsoft.VisualStudio.Composition.ExportProvider.GetExports(ImportDefinition importDefinition)
at Microsoft.VisualStudio.Composition.ExportProvider.GetExports[T,TMetadataView](String contractName, ImportCardinality cardinality)
at
Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T,TMetadataView](String contractName)
at
Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T](String contractName)
at
Microsoft.VisualStudio.Composition.ExportProvider.GetExportT
at
Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValueT
at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetServiceT
at Microsoft.VisualStudio.VC.ManagedInterop.<>c.<Initialize>b__52_15()
at
System.Lazy`1.CreateValue()
at
System.Lazy`1.LazyInitValue()
at
System.Lazy`1.get_Value()
at
Microsoft.VisualStudio.VC.CodeAnalysis.ResultTaggerProvider.CreateTagger[T](ITextBuffer buffer)
at
Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.GatherTaggers(ITextBuffer textBuffer)
--- End of stack trace from previous location where exception was thrown ---
at
Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
I have Visual Studio 2017
So why does running the file (with the local windows debugger button) say that there were build errors? And how can I fix it?
When it prompts the build error, and I click no it usually shows the errors but in this case it doesn't, yes will just run the last "successful" build (although I haven't changed the file since I have finished it before this error message started popping up)
Also there is no error in my code as I was able to run it before the build error kept appearing and I haven't touched the file since(only now to show the problems are)
Thanks for your time! if anything was unclear because of my English, comment and I'll try to clarify it
I fixed the error by deleting ComponentModelChache folder located at:
C:\Users\%userName%\AppData\Local\Microsoft\VisualStudio\15.0
15.0 is the version of your visual studio so it varies depending on the version you're using, %userName% is a replacement for the user you're logged in as

Visual Studio 2015: C++ code analysis error C1253, unable to load model file 'res://mspft140.dll/300'

Visual Studio 2015 Community update 3, trying the C++ code analysis feature. The settings are as follows:
solution properties > code analysis settings > [all configurations] [all platforms] : microsoft native recommended settings
project properties > code analysis > [all configurations] [all platforms] : microsoft native recommended settings
Whenever I run analyze > run code analysis on solution I would always get a c1xx : fatal error C1253: Unable to load model file 'res://mspft140.dll/300'. This happens to every project, new or existing. MSDN is not particularly helpful about this one.
The string is a res protocol, so I checked if the dll mentioned is at its correct location (there are two actually, at c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\ and c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64), and opened them with resedit. Both contain an XML resource named 300, so I don't see any reason for VS being unable to load it. Resetting the settings didn't help, full uninstall and reinstall (half a day wasted) did neither.
I also ran procmon with [Path] [contains] [mspft] filter while running the code analysis in VS, but the file system results are only SUCCESS and FILE LOCKED WITH ONLY READERS, which seems to be ok.
Did anyone experience this error? Does anyone have any surmises about its cause?
Update: After looking thoroughly through many more procmon captures with different filters I found out that cl.exe tries to open this registry key value: HKCR\PROTOCOLS\Handler\res\CLSID. Clearly it looks for the handler of the res protocol mentioned in the error output - and it's not there to be found, while many siblings of res key refer to some valid handlers, for example, http key has CLSID value of {79eac9e2-baf9-11ce-8c82-00aa004ba90b}. I guess that my quest for now is figuring out what that res CLSID is meant to be.
I was right in my assumption about the res protocol handler. The correct HKCR\PROTOCOLS\Handler\res\CLSID value is {3050f3bc-98b5-11cf-bb82-00aa00bdce0b} (which refers to C:\Windows\System32\mshtml.dll). For some reason my registry was missing it; as soon as I added the value, the code analysis started working without errors.
I hope this helps someone, although I believe the bug is extremely rare.

Connection from Toad 11 to TFS 2010

currently I try to connect to our TFS2010 server with Toad Team Coding.
I've tried to follow this documentation, but it's for Toad 10.6 and some of the windows look different. Still I was able to connect to our collection and see all our Team Projects we have.
The problems start, when I try to export something to TFS.
Team Coding Code Collections -> Create new revision...
There I select e.g. all Packages and click "OK", then I get the Export Options -> OK
Then I just get a bunch of errors:
"Unable to add revision from VCS repository. Error uploading file: C:\temp...."
The progess window in the background says: "Package xyz has been added to the VCS."
Now I have a bunch of PKS/PKB files in my folder and Visual Studio shows me, that I have new files with Pending Change "add".
Team Coding Viewer shows me all the files with status "Available", checkin is grayed out, checkout gives the same error as above and the info window at the bottom shows:
15:29:46 Error: Cannot create file
"C:\Users\abc~1\AppData\Local\Temp\$111.11.1.11:1521\xxx.50510.PKB".
Die Syntax für den Dateinamen, Verzeichnisnamen oder die
Datenträgerbezeichnung ist falsch
(Translation for the last part: Syntax of filename, foldername or diskname is wrong).
At this point it doesn't make sense to go on. Toad will show the files now as checked out, but in TFS they are still with the "add" change. Toad acts like the checkin/checkout was successful (window at the bottom) and shows the error for every file.
Any idea? Any new tutorial to set up Toad 11 with TFS 2010?