Where are the values in AssemblyInfo.cpp generated from? - c++

I just started a project on my HP laptop and visual studio has populated the AssemblyInfo.cpp file with details from the laptop it would seem:
[assembly:AssemblyCompanyAttribute(L"HP")];
[assembly:AssemblyCopyrightAttribute(L"Copyright (c) HP 2017")];
Where are those values coming from and can I change them to match the company I work for so that when I create a new project it comes up with the correct values?

If it's VC++ project,turn to "Resource View",Double click "Version",you can then set your company name or other informations like file version,Description,etc.
Actually,It should be something like a default name:"" or "".Seems no way for you to "set once,use forever".

Related

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

Registry not set using Visual Studio 2017 Installer Project

I create a visual studio installer project on visual studio 2017 for word add-in.
The registry is not set when installing it. What do I do wrong during the process?
I have a MyWordAddIn solution which when running through visual studio correctly open Word 2016 and launch the add-in. I went to the HKEY_CURRENT_USER/SOFTWARE/Microsoft/Office/Word/Addins/ and find the myAddIn folder which has been created by visual studio during the debug run.
I now no that I must add 3 string value :
Manifest : file:///[the local directory]/MyWordAddIn.vsto|vstolocal
Description : "MyWordAddInName"
FriendlyName : "My word Add-In name"
and 1 binary value :
LoadBehavior : 0x00000003
Back to My Installer Project MyWordAddInSetup :
right click on it > view > File System :
In the Application Folder I added the Assembly used by my project, the primary output, the manifest and the MyWordAddIn.vsto file.
right click on MyWordAddInSetup > view > Launch Conditions :
set the right .NET FrameWork (4.7.2)
right click on MyWordAddInSetup > view > Registry :
In the HKEY_LOCAL_MACHINE I created the following key tree :
SOFTWARE/Microsoft/Office/Word/Addins/MyWordAddIns
Then, I added three string value in MyWordAddIns :
Manifest : file:///[INSTALLDIR]/MyWordAddIn.vsto|vstolocal
Description : "MyWordAddInName"
FriendlyName : "My word Add-In name"
and 1 binary value :
LoadBehavior : 0x00000003
When Installing my MyWordAddIns, the Assembly, dll, manifest and vsto file are well created inside the chosen folder.
But the local registry is not set with the value I wanted.
If I create it myself then the add-In is correctly added in Word 2016.
I tried to create a simple key 'Test' in the HKEY_LOCAL_MACHINE in the Registry tab of my MyWordAddIns installer. And even that, the 'Test' folder does not appear in the HKEY_LOCAL_MACHINE registry of my machine.
If I set those registry valuenot in the HKEY_LOCAL_MACHINE but in the HKEY_CURRENT_USER it well create the values.
Any solution to corectly set the values in the HKEY_LOCAL_MACHINE ?
I found the problem. It was a user mistake.
To have the key values set in the HKEY_LOCAL_MACHINE you must click on 'Everyon' button during the Installation

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.

Debugger multiple environment variables in C++ Microsoft Visual Studio 2010

I got a very simple problem with the Visual Studio 2010 Professional C++ debugger when setting environment variables.
Described in
http://msdn.microsoft.com/en-en/library/kcw4dzyf.aspx
Paragraph "Environment (Local Windows Debugger)".
I created a standard Win32 console project. I am setting the environment in project properties → Debugger:
TEST=asdf
OTHER=qwer
And printing the environment variables in the _tmain(...):
cout << "Hello " << getenv("TEST") << endl;
I would expect an out like:
"Hello asdf"
But instead I always get:
"Hello asdf OTHER=qwer"
How to fix this?!
It seems to be a DEU version bug.
I just filed a bug report:
https://connect.microsoft.com/VisualStudio/feedback/details/727324/msvs10-c-deu-debugger-environment-variables-missing-linefeed#details
Running into a similar problem feeding this property programmatically, I bumped into this github file. The separator is "
" in xml format, a.k.a. line feed. Using Environment.Newline solved the issue in dot net.
In interactive mode within the GUI, you want to click the edit button and use the rerun key to split your variables.
Best solution so far:
Considering your example:
TEST=asdf
OTHER=qwer
Edit the .vcxproj adding inside <Project>:
<Project .... >
...
<PropertyGroup Label="UserMacros">
<TEST>asdf</TEST>
<OTHER>qwer</OTHER>
</PropertyGroup>
...
</Project>
You can also add this on a *.vcxproj.user or a *.props file as you prefer.
Do you need to separate the environment variables with semicolons or some other kind of delimiter? It seems like TEST is getting assigned to asdf OTHER=qwer, not just asdf.

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?