I think it is common to let t4 template automatically check out files from TFS when transforming the template. But i transform the template, i got error:
Running transformation: System.UnauthorizedAccessException: Access to the path 'C:******.cs' is denied.
Is there any way to overcome it?
either check out the file first, or add a prebuild step to attrib the file before building.
It is not recommended to put generated files under source control. You should exclude them with .tfignore or .gitignore then delete them from your repo.
This will prevent the issue that you are experiencing.
As the files are generated on build there is no need to retain and already old version in source control.
Related
VSTS Build definition fails at Get Sources step from TFS.
Below is the error:
"error]Microsoft.VisualStudio.Services.Agent.Util.ProcessExitCodeException:
Exit code 1 returned from process: file name 'tf', arguments 'vc get
/version:131 /recursive /overwrite D:\a\3\s /loginType:OAuth
/login:.,*** /noprompt'."
Please help.
You might see this error when the changes that you are trying to check in contain a file/folder to a location that is not mapped to list of sources with the build definition.
Error message is not beautiful enough but it is there to stop accidental check-ins.
Scan through your pending changes and see if there is any file that is from a folder that is not mapped as a source folder in build definition.
If there is one, either add that path to build definition folder list or move the files into a folder that is mapped as source folder.
Close all projects.
2 Connect to your repository.
In pending changes do not filter by any project, just see all files which is it check-in.
Map and check-in files and folders.
Try to build again
I want a run a build step that looks at a .h file, adds some code based on some external params, and hands the resulting file to the preprocessor.
I see the "Custom Build Step" in the project properties. It seems to need an output file. I just want to forward the results to the preprocessor.
It seems like the custom build step wants to do a 1-time process, not per-file or by file type.
The problem is that I don't know how to send my external executable the file currently being processed (eg, "HelloWorld.cpp"). $(InputName) and %(Filename) are blank and docs say it's deprecated. How do I send the filename to my external executable?
But even if I get that working, I don't want to set this per-file. I want all header files to go through this process.
Any ideas?
I've looked at:
https://msdn.microsoft.com/en-us/library/dd293663.aspx?f=255&MSPPError=-2147217396
https://msdn.microsoft.com/en-us/library/hefydhhy(v=vs.90).aspx
https://msdn.microsoft.com/en-us/library/ff770593(v=vs.140).aspx
working on a debug, x64 config on windows.
First of all, No, you cannot modify a file and pass along the results to the next stage (that I could see). I'd need some sort of Program Transformation System.
So I need an intermediate file. That file has to be added to the project, even if it gets overwritten by your code generator. I can associate c++ header files with a custom build tool, and they will all get called one-by-one in the stage of the build specified in the Custom Build Step. The custom build tool will modify the intermediate file(s), and all is well.
The VS 2015 name for the current file being processed is %(Filename). In older versions it has been $(ProjectName) and $(InputName).
I have a very large VC++-Project which takes a long time to Rebuild after i edited a file. Maybe it's a central-class and so the following classes have to be rebuild, too. I'm using class-definitions and do include the header in the cpp-file, not .h-file in .h-file ;-)
Is there a way to find out which class/file is resposible? Are some useful tools to visualize the includes in a graph/dependencygraph? How do you get it?
Any file which directly or indirectly (through another include) #includes the file you changed will have to be rebuilt. Also if you have custom rules (say, the file you are editing is part of a custom rule that generates new source files), then any files changed by this rule and their dependencies will also have to be rebuilt.
MSDN Doc for visualizing the dependency graph:
http://msdn.microsoft.com/en-us/library/ff657798.aspx
ElectricAccelerator can help you answer this question by giving you an XML-annotated build log that includes information about which files are accessed during the compilation of each object, and the build time for each object. It has a Visual Studio plugin so it integrates right into your current environment.
Disclaimer: I'm the architect of ElectricAccelerator
if a file is checked out in ClearCase; it would use the earlier version and still would build, is this correct? I'm thinking they had a checkout that was to fix a build issue and the build failed because of the checkout
as far as I know, clearcase using the current file, so if file is checked out in a view and you build this view it will take the checked out file
However, note that if you do uncheckout and you are not using cmake, it might miss this change, since the timestamp of the file after the uncheckout operation is older
The config spec of a view usually starts with:
element * CHECKEDOUT
That means that, yes, your view will select the current file, whatever the other selection rules are.
I recommend checking for files in checkout, but also hijacked files (modified locally without having been checked out, for snapshot view, or even eclipsed files for dynamic views) before starting a build.
Check also for any other "private" files (not initially present and selected in the view), because they also can influence a build by their presence.
I will be creating a series of projects set up to build COM objects. I attempting to create a property sheet (.vsprops file) which will set up the builds for each project. One of the things I am doing with the properties file is customizing the location and names of the files created by the MIDL compiler. Here's the code I use for this:
<Tool
Name="VCMIDLTool"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(RPCDIR)"
HeaderFileName="$(InputName).h"
DLLDataFileName="$(InputName)_dlldata.c"
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"
/>
RPCDIR is a macro defined before this section of the property file. This works great for compiling the code. When I build my project, these five files are created with the correct names in the location I specified in the RPCDIR macro. My problem is when I try to clean the build. The clean successfully deletes four of the files, but the DLL Data File does not get deleted. I'm especially confused that some are deleted and one is not - I would have thought that either they would all be deleted or none be deleted rather than a split like this.
Does anyone know how I can customize the clean build to correctly delete these files? Optimally any changes I need to make would be in the property sheet so that I can share it with other projects, but if that's not possible then I'd like to at least be able to do it in the project file. Thanks in advance for any help you can offer!
Not your problem, it is a bug in the build system. The dlldata.c file doesn't get deleted using a regular build either. There aren't enough diagnostics available in the msbuild .log files to see what target fumbles this. I'm guessing it has something to do with the <FilePatternsToDelete> item in the Microsoft.CppClean.targets file.
I recommend you report this problem at connect.microsoft.com