Download prerequisite from the following location in window installer of VS 2013 - visual-studio-2013

I want to download prerequisite from the my server location. I am using VS 2013.
we have three option to download prerequisite.
Download prerequisite from the component vendor's website.
Download prerequisite from the same location as my application
Download prerequisite from the following location
I want to go with 3rd option.
When i try with third option than i get this error:
"Error 1 To enable 'Download prerequisites from the same location as my application' in the Prerequisites dialog box, you must download file 'DotNetFX451\NDP451-KB2858728-x86-x64-AllOS-ENU.exe' for item 'Microsoft .NET Framework 4.5.1 (x86 and x64)' to your local machine. For more information, see http://go.microsoft.com/fwlink/?LinkId=239883. D:\Projects...VersionSetup.vdproj DetectFrameworkVersionSetup
"
Thanks in advance.

You can find multiple directory inside the path : C:\Program Files (x86)\Microsoft SDKs\Windows
Like v7.0A, v7.1A, v8.0, v8.0A, v8.1, v8.1A....
Bootstrapper packages at : C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\Bootstrapper\Packages
Series 7 used for the .net version 2010 and
Series 8 used for the .net version 2013
If you are preparing setup project in VS 2013 and want to download prerequisites with
Download prerequisite from the same location as my application
Download prerequisite from the following location
than setup project search for the bootstrapper file in side that folder.
i.e :
if i select .net framework 4.5 as a prerequisites than setup project find the .net framework 4.5 exe file in side the "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\Bootstrapper\Packages\DotNetFX45".
So just copy appropriate exe file inside "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\Bootstrapper\Packages\" and try to build project.

Related

MSBuild offline installer that comes with visual studio 2017 build tools not able to build project in Release mode

Step 1 - I have installed visual studio build tools by downloading
vs_BuildTools.exe from this site (you will require to login to microsoft account to browse this URL)
Step 2 - I created offline installer by following various articles particularly this one
And created zip file offlineBuildTools17.zip
Step 3 - Copied offlineBuildTools17.zip file to Build server which doesn't have internet connection.
Build server is Windows server 2012 R2.
Step 4 - Extracted Zip file on server and installed Build tools. Installation goes smoothly.
I could see installation files in
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft
Step 5 - I have simple DLL and Console application (.exe) project in my solution. These are simply 'hello world' application NOT USING DOT NET CORE. I am using .net frameowrk 4
Problem: I am unable to create release mode dlls and exe
Same thing is working on my laptop where I have installed visual studio 2017 community edition.
On laptop where visual studio 2017 installed
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild" <optional project.csproj> /p:Configuration=Release
This creates dlls and exe in bin\Release folder of project
But the same doesn't work on Build server.
Always creates dlls and exe in bin\debug folder.
My final goal is to create 'publish' folder
This is weird but it is solving my problem.
if i ran following command - msbuild is always generating Debug binaries. which was my original problem. it doesn't generate release mode binaries at all
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\"msbuild /p:Configuration=Release /t:publish /p:OutDir="./Publish"
But if i write following command , (note how msbuild is placed in double quote along with mbuild full path) it is working fine. it generates release mode binaries and also publish folders.
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\msbuild" /p:Configuration=Release /t:publish /p:OutDir="./Publish"
thanks

The “GetReferenceNearestTargetFrameworkTask” task was not found

Given: My local system references MSBuild at "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSbuild.exe". My automated build server (Jenkins) does not have this version of MSBuild so I used chocolatey to download microsoft-build-tools.
Problem: My visual studio project compiles successfully locally but won't compile successfully on my automated build server (Jenkins) due to a ReferenceAssembly error:
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1179,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.2" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
I've searched online and found a possible solution https://developercommunity.visualstudio.com/content/problem/137779/the-getreferencenearesttargetframeworktask-task-wa.html where the powershell script modifies Microsoft Build Tools installer:
Start-Process "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" -ArgumentList 'modify --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools" --quiet --add Microsoft.VisualStudio.Component.NuGet.BuildTools --add Microsoft.Net.Component.4.6.2.TargetingPack --norestart --force' -Wait -PassThru
I ran the script and I could see that it modifies the installer to select the specified target 4.6.2. However, the target package 4.6.2 is not present in the path "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework". I think it successfully downloaded the package one time but I deleted it to see if it was reproducible in my build server (Jenkins).
I don't want to manually paste the v4.6.2 target package from my local system to the build server. Any ideas on how to resolve this reference assembly problem?
For "GetReferenceNearestTargetFrameworkTask":
You can use powershell to call installer.exe, and install the components you lack.
Also, you can start vs installer in your server and modify your build tools to install packages below:
Any ideas on how to resolve this reference assembly problem?
If they are unchecked, check them and click modify button to install them by vs installer.exe.
And if they are checked, uncheck them and click modify to remove completely. After that, check them to reinstall the 4.6.2 framework.
Update:
After my check the modify in the Get Tools and Features can't help resolve assembly while they should.This option can only work to install new framework(which not once installed) but not repair the 4.6.2 once installed but now broken.
Download this developer pack manually and run it can help resolve the missing packages.
In addition:I delete the v4.6.2 folder in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework and get it back by run the pack to repair.

Teamcity: error MSB3147: Could not find required file 'setup.bin'

C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.target
error MSB3147: Could not find required file 'setup.bin' in ... folder
I have seen there are similar messages during the time frame of last upgrade of VS for 2012.
I did not find the registry keys on the build server as mentioned in other posts i.e. Could not find required file 'setup.bin'
I appreciate your help.
Teamcity: error MSB3147: Could not find required file 'setup.bin'
According to this blog entry the bootstrapper files are installed during the .NET Framework SDK/Visual Studio IDE install. It also shows the registry entries that are searched to look for the bootstrapper directory.
If one computer that does not have .Net Framework SDK/Visual Studio IDE installed(such as, build server), none of the registry key would be set.
I did not find the registry keys on the build server as mentioned.
You can install .Net Framework SDK/Visual Studio IDE on the build server to get this registry key. If you don not want to install them, you could manually set it up by following steps:
Copy the whole C:\Program Files (x86)\Microsoft Visual Studio 14.0\SDK folder from the local machine with Visual Studio IDE installed to the server.
creating the 14.0 registry key and adding the value:
For 86bits:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\GenericBootstrapper\14.0]
"Path"="C:\Program Files (x86)\Microsoft Visual Studio 14.0\SDK\Bootstrapper"
For 64 bits:
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\GenericBootstrapper\14.0]
"Path"="C:\Program Files (x86)\Microsoft Visual Studio 14.0\SDK\Bootstrapper"
Note: Visual Studio must be restarted.
I don't have SDK installed on the server. I have updated the .csproj with
<PropertyGroup>
...
<BootstrapperEnabled>false</BootstrapperEnabled>
</PropertyGroup>
That fixed the build.

Visual Studio Team Services build process cannot find CSharp targets file

I'm trying to set up a build process in Visual Studio Team Services, and I've done so by following the steps for UWP projects using an agent on my box, but I keep getting the following build errors:
C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v12.0\Microsoft.Windows.UI.Xaml.CSharp.targets(7,3): Error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v12.0\10.0.10240.0\Microsoft.Windows.UI.Xaml.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
I checked out the path the build is complaining about and the problem is in the 10.0.10240.0 in the path:
C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v12.0\10.0.10240.0\Microsoft.Windows.UI.Xaml.CSharp.targets
The target file is located in
C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v12.0\Microsoft.Windows.UI.Xaml.CSharp.targets
Here is how the declaration in the project file looks like (I don't think it is erroneous and I don't see where this weird 10.0.10240.0 version comes from in the path):
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
Any suggestions on what could be wrong and how can I fix that?
The Universal Windows Platform was introduced in Windows 10. Visual Studio has support for UWP apps as of Visual Studio 2015. You need to use VS2015 to create a UWP project, and install VS2015 on your build agent machine.

Why are windows definitions missing on msvc++

I have not been coding in MSVC lately. I have been assigned an old code that has lots of errors but most of the missing definitions are of Windows API.
For example, LPHANDLER_FUNCTION_EX is not defined and is causing C2061 compile error. But I already included Winsvc.h or Windows.h. I know that this is just a definition, I checked my C:\Program Files\Microsoft SDK\ for the definition can be found on the Winsvc.h. So I added the SDK on the directory list (Tools > Options > Directory Tab).
I also downloaded the Windows SDK February 2003 update which is the last version that works with msvc6. (ref)
Just for completeness, My PC is Windows XP SP3. Microsoft Visual C++ Enterprise Edition with SP6 installed. I also installed the Windows SDK February 2003 update.
Any ideas?
I was able to solve this by fixing the order of the include directory via Tools > Options > Directory Tab.
Before the VC98 folder was on top of the SDK.
1st C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE
2nd C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE
3rd C:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE
4th C:\Program Files\Microsoft SDK\include
Just place the SDK directory to the top of the list and it works.
The suggestion to use /E option by jamesdlin was helpful. Also I set the /E option in the Project Settings > Library Tab > Project Option textbox. The log would be placed in the .plg file inside the project folder.
This would also apply to missing lib file. Set the directory to the SDK directory for library.

Resources