I have a solution with various BizTalk projects (maps, schema, etc.)
How can you increment each projects "Assembly File Version" in a build, whilst leaving the "Assembly Version" unchanged?
Project Properties, Application tab, Assembly Information button.
In that dialog, you will see both Assembly version and File version.
Reminder, all the .Net rules apply. File version is for display in Explorer only, it has no effect on any .Net operation.
The Assembly version can be auto incremented by placing an asterisk in any of the places.
Unfortunately, Assembly File Version does not support the wildcards. If you Bing 'Increment Assembly "File Version"' a number of alternatives come up.
Related
I'm building a solution containing .NET Standard 2.0 and .NET Core 2.0 projects (C# and F#) in VS2019 (16.1.1). If I build multiple times without changes the second and subsequent builds should say "Build: 0 succeeded, 0 failed, X up-to-date", but it sometimes rebuilds some projects every time. How do I find out exactly why?
There are many SO questions and blog posts about this, most of them suggesting setting the build log verbosity to "Diagnostic" and looking for "not up to date". I've done that and the string is not found, nor is "not up-to-date" (but "up-to-date" occurs many times). So this appears to have changed in VS2019. I also know about the U2DCheckVerbosity registry setting, but that's only for .NET Framework. Reading through the build log output is unrealistic, as it's over 360 thousands lines, so I need to know what to search for.
Please note, I'm not looking for guesses as to what the problem might be - I'm looking for a way to get VS/the compiler to tell me.
I'm looking for a way to get VS/the compiler to tell me. (For VS2019)
It's hard to reproduce same issue so I'm not sure about the cause of your issue. But as for what you're asking is the way to find up-to-date related info in Output window, maybe you can check the Up To Data Checks option for .net core.
Go Tools=>Options=>Projects and Solutions=>.net core=>Up To Data Checks. Make sure you've checked the Don't call MSBuild if a project appears to be up-to-date. Then change the Logging Level to Info or Verbose.(Choose the suitable level according to your needs)
For the normal .net framework projects or C++ projects, the build output verbosity in build and run would be of great help. But when trying to find the reason why VS consider one .net core or .net standard project is out-of-date, I think we can try this option since its output is more clear.
E.g: (One .net Core project which depends on the Standard project with Info level .net core Up-To-Date Check):
And if you have too many projects in one solution, I suggest you build one project one time instead of build the whole solution so you can locate the cause of the rebuild more easily.
VS writes a file called NETCoreApp,Version=v2.0.AssemblyAttributes.cs into temp folder. If you build several .net core projects, the file gets changed by the other project and your VS thinks the old project is modified and builds it.
Move the generated files into the project to reduce the builds:
<PropertyGroup>
<TargetFrameworkMonikerAssemblyAttributesFileClean>False</TargetFrameworkMonikerAssemblyAttributesFileClean>
<TargetFrameworkMonikerAssemblyAttributesPath>$(MSBuildThisFileDirectory)SharedAssemblyAttributes.cs</TargetFrameworkMonikerAssemblyAttributesPath>
</PropertyGroup>
In VS2019 the option to control logging is:
The default is "None", but honestly "Minimal" is a good setting in general. When set to that level, only a single line is output per project, and only if that project is not up-to-date. That line will explain exactly why the project is considered out-of-date.
It's worth remembering that this is Visual Studio's up-to-date check, which it uses to quickly assess project state and avoid the comparatively expensive call to MSBuild. It is possible, with exotic project configurations, that VS determines your project needs building, but MSBuild doesn't actually build. This is rare, but can be worth understanding if you're debugging issues here.
Historical context:
We have a project consisting of following parts:
Host application (C++)
Scripting Engine library (also written in C++)
A lot of C++ plugins (around 30+)
A lot of scripts that tie all the stuff together...
From version to version some plugins are added and some are removed.
Till now we used Visual Studio solution (*.sln) to contain all the projects (*.vcxproj) for Host application, Scripting Engine library and plugins (one *.vcxproj per plugin!).
To share sources/projects we use proprietary source control system, and till now once we merged updates from the server (some plugin projects are added and some plugin projects are removed) all the project tree in the VS were refreshed thanks to "reload" feature (no action was required from developer to see and build updated source tree).
The problem:
Now our senior management decided to switch to Eclipse CDT/MinGW pair and we faced the issue that Eclipse Workspace is not the same thing as Visual Studio *.sln ...
Now when some plugin project folder appears or some plugin project folders disappears corresponding workspace items do not update accordingly.
Thus from now every developer has to use File>Import...>General>"Existing projects into workspace" File/"Open Projects from File System" to add new projects to own Workspace manually once they were added by other developer to the source control.
Also one has to manually remove from own Workspace those plugin projects that were deleted from source control...
This is a great contrast with what we previously had with Visual Studio where "reload" feature automatically updated project/source tree (just bacause all the information arrived with *.sln/*.vcxproj from server).
Our first option was to place Workspace\.metadata etc stuff to source control (as we previously did for *.sln files) but "that is not the way how Eclipse Workspace is designed to be used" (this is even not possible just because paths in .metadata\* are absolute and tons of Workspace\* stuff it is not mergeable at all)
Question:
Is there some way to automatically syncronize Eclipse CDT Workspace with project set obtained from source control. Like just press some (hidden?) magic "refresh" button (in special plugin to install or something like that) and all the new projects will be automatically added to the source tree in the Workspace and deleted projects will also disappear automatically, wothout need to use all those "Import" wizards, and withot need to remove deleted projects manually?
May be there is a special "Container" project type in Eclipse to play the same role as *.sln did in Visual Studio or something like that?
May be other options available?... Overall intention is not in replacing *.sln by some Eclipse equivalent but to support similar workflow when bunch of plugin projects is managed as a whole and project set "refresh" to be simple operation that does not require from each person in the team to manually track projects appeared/disappeared in that set.
Have you looked at using CMake to generate the Eclipse project files? You can then import those into an Eclipse workspace.
Its not automatic, but if you create separate CMakeLists.txt files for each part, then you can easily comment the include of that part in the main CMakeLists.txt file and regenerate the project files when you only want to load subset of the project.
https://cmake.org/Wiki/Eclipse_CDT4_Generator
Should you ever want to change back to VS or to another IDE CMake can generate project files for that too.
I've personally only used CMake to generate VS-solutions and Unix make files so I can't vouch for how well this works.
HTH.
On side note, why did management decide that Eclipse should be used instead of Visual Studio? It sounds like a poor decision without factual grounds or impact research prior to the decision being made.
Was it because Eclipse is free? Did they consider what reduced developer productivity costs?
I am currently migrating a reasonably large solution from VS2008 to VS2012. To date, this solution has been dependent on a command line build for several build steps, and I want to use the project system properly to execute these build steps. I've been through the various options and decided that a custom build step makes sense in most of the VC++ projects that require it. The solution is a mix of C++, C# & VB.
These tasks include building Primary Inter-op Assemblies and processing output files using third-party utilities, where the input and the output are the same.
I've had some teething issues, but I'm mostly up and working with this approach. The remaining issue is one of deploying these additional outputs to dependent projects.
Consider this; I have a third-party component, which given an input of a.dll produces two outputs, a revised a.dll and a_util.dll. When I have a project that is dependent on a.dll, I now need that project to pull a_util.dll in to it's output too. I was hopeful that the "Treat Output as Content" field on the custom build step in VS2012 would help in this respect, but I'm going by the one-liner in the UI, I can't find any comprehensive documentation on this option. In fact, the MSDN documentation just pretends this option doesn't exist.
If anyone can help explain this option, or an alternative approach, that would be great.
EDIT
At the moment, I am adding a BeforeBuild target to each dependent project to copy the additional outputs into that dependent project. The problem with this approach (while it works) is one of maintenance. Unfortunately if a dependency of this type is missed, it results in a cryptic runtime error.
Here's a link to VS2013 documentation that says:
Treat Output As Content: This option is only meaningful for Windows Store or Windows Phone apps, which include all content files in the .appx package.
In a presentation by Bungie (A Life on a Bungie Farm) a feature in Visual Studio named 'Source Stamping' is mentioned. I would like to read a bit more information on that subject but finding related information on MSDN proofed to be difficult.
"We also use a feature of Visual Studio called source stamping, which is a linker setting that is used to specify the final location on a server of the version of the source code that was used to build a certain set of binaries. The source is copied up to that location when the build finishes, and since that location is stamped into the pdbs Visual Studio knows that when it is debugging a build off the build site, it should pull the source from that location to use while stepping through the code.
"
What I am looking for is some information that describes the linker setting(s) in question to setup a similar build/debug-environment.
To complement my question. I may have been a bit premature. A part in the presentation that I over-read mentions the exact linker setting /SOURCEMAP. But this appears to be undocumented.
This feature is called Source Server, where the information needed to extract the right source revision is embedded into the PDB using the tools and scripts listed on the Source Server page.
Using this system, as long as you have access to the private (unstripped) PDBs for your project, your debugger can retrieve the original source file from your version control system. Supported systems are Team Foundation Server, Perforce, Visual SourceSafe, CVS, and Subversion.
I don't know the specific details, but the compiler can very probably put some cryptographic quality hash of the source code in the executable.
(Imagine that you'll add in the executable the md5sum -or better- of a source code compiled in).
Can anyone point me in the right direction how to configure Visual Studio 2005 with our C++ console project how we can include a 'File Version' in the details section of the file properties.
I've tried resource files without any luck. This is with a C++ project just for clarification, and big thank you for the guys you responded with C# suggestions.
Thanks in advance.
If you are talking about unmanaged c++, you need to add a version resource to the project.
right-click on the project, choose add - Resource.... Choose Version and press new.
There you can enter all info you need.
You have to have one VS_VERSION_INFO section in your resource (*.rc) file(s) that compile into your project.
In the Visual Studio 2005 Solution Explorer, open the context menu on your C++ project and choose Add, Resource.
Mark Version and click "New".
Fill in the fields as desired and save the file.
Build.
Now your project output has a FileInfo resource.
Please be aware that Windows Vista does not show all available version info in the Explorer context menu's "Details" tab.
For c++ projects I use StampVer and call it as a post build operation including check in/out of revision control for release builds.
Unless you have a good reason for your file version to be different than the version of the assembly inside, I think it is a better idea to provide the AssemblyVersion alone. If you do not specify an AssemblyFileVersion, it will automatically get the same value, so you can see your assembly's version directly in the file's properties.
The advantage is that you can use a wildcard and allow the version to be automatically incremented, so that every time you compile the library you get a different build and/or revision number. As far as I can tell, this trick does not work with AssemblyFileVersion, so you have to increment it by hand.
Of course, all this only applies if you're writing .NET code. Are you by any chance talking about a project using unmanaged code?