I am in the process to setup our new Win7 build machine for our C# project. We don't want to install Visual Studio on that machine. So I am following the instruction "Running mstest without Visual Studio" to setup our machine.
On step 3:
Put Microsoft.VisualStudio.QualityTools.Resource.dll and
Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll in the GAC on the CIServer,
because that is where they are on the DevMachine.
On my develoopment machine (installed Visual Studio 2008 professional version) I found both of them in my GAC (C:\windows\assembly) but I searched my entire development machine and couldn't find the Microsoft.VisualStudio.QualityTools.Resource.dll
My questions are:
where to get the Microsoft.VisualStudio.QualityTools.Resource.dll?
can I copy above file from GAC? (I tried gacutil.exe, there is no such copy option. I tried Control Panel->Administrative Tools, but my XP machine only has Microsoft .Net Framework 1.1 Configuration on which above two assembly didn't show up.)?
thanks,
You can copy files from the GAC via cmd.exe. E.g.:
copy C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.QualityTools.Resource\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.QualityTools.Resource.dll C:\Temp
Adjust the version appropriately.
Windows Explorer just replaces the subfolders in C:\Windows\assembly with the aggregated view you might know.
my Version Of this Dll currently sites at the following location C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0 due to using vs2010 so change the path accordingly to get it from your machine
if you need to run this in isolation create a tools folder in your folder structure thats checked into source control and then reference the dll from that tools folder and NOT from the GAC. this means that when it builds on the build machine it wont need Visual Studio installed
Maybe you have a 64 bit machine. In that case, it's here.
C:\Program Files (x86)\Microsoft Visual Studio
10.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll
Run the command below if you use VS2008
copy C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.QualityTools.Resource\9.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.QualityTools.Resource.dll c:\temp
Related
Whether user can customize the below vswhere.exe path while visual studio installation?
C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe
Reason for asking this query is ,I used vswhere exe for find the VS2017 & 19 installation path in my project.
"VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
Suggest any other way to find the Vswhere exe path.
From Microsoft ( https://github.com/Microsoft/vswhere/wiki/Installing ) :
Starting with Visual Studio 15.2 (26418.1 Preview) vswhere.exe is installed in
%ProgramFiles(x86)%\Microsoft Visual Studio\Installer.
(use %ProgramFiles% in a 32-bit program prior to Windows 10).
This is a fixed location that will be maintained.
This means that vswhere will be located at %ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe no matter what options the user chose on the Visual Studio installer or MSBuild Tools installer.
Note that if you install vswhere using Chocolatey (instead of the VS/MSBuild installer), it will be located at %ProgramData%\chocolatey\lib\vswhere\tools\vswhere.exe
I have a c# solution (open source, available here: https://github.com/tzachshabtay/MonoAGS) which I can compile fine from Visual Studio 2017 (Dot net framework) and from VS for Mac (Mono). I can also compile it with msbuild on Travis CI successfully on both linux and mac (https://github.com/tzachshabtay/MonoAGS/blob/master/.travis.yml).
What I can't do, is compile it on command-line from Windows 10 on my local machine. I'd like to be able to compile it both for DotNet Framework and Mono.
So I tried using MSBuild from both the mono installation and from the Build Tools for Visual Studio 2017 (note: I want to be able to install on windows even if vs2017 is not installed, though on the local machine vs2017 is installed, don't know if it matters).
Both installations are for the latest versions as of today.
This is the error I get from msbuild on mono (PATH was set to %programfiles(x86)%\Mono\bin):
Project "C:\Github\MonoAGS\MonoAGS.sln" (1) is building "C:\Github\MonoAGS\Source\Tests\Tests.csproj" (2) on node 1 (default targets).
Project "C:\Github\MonoAGS\Source\Tests\Tests.csproj" (2) is building "C:\Github\MonoAGS\Source\AGS.API\AGS.API.csproj"
(3) on node 1 (GetTargetFrameworks target(s)).
C:\Program Files\dotnet\sdk\2.1.4\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props(29,11): error MSB4226: The imported project "C:\
Program Files (x86)\MSBuild\15.0\Microsoft.Common.props" was not found. Also, tried to find "15.0\Microsoft.Common.prop
s" in the fallback search path(s) for $(MSBuildExtensionsPath) - "C:\Program Files (x86)\MSBuild" . These search paths
are defined in "C:\Program Files\Mono\lib\mono\msbuild\15.0\bin\MSBuild.dll.config". Confirm that the path in the declaration is correct, and that the file exists on disk in one of the search paths. [C:\Github\MonoAGS\Source\AGS.
API\AGS.API.csproj]
And here's the error I get from msbuild from build tools (PATH was set to %programfiles(x86)%\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin):
Project "C:\Github\MonoAGS\Source\Tests\Tests.csproj" (2) is building "C:\Github\MonoAGS\Source\AGS.API\AGS.API.csproj" (3) on node 1 (GetTargetFrameworks target(s)).
C:\Github\MonoAGS\Source\AGS.API\AGS.API.csproj : error MSB4247: Could not load SDK Resolver. A manifest file exists, but the path to the SDK Resolver DLL file could not be found. Manifest file path 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\SdkResolvers\Microsoft.Build.NuGet
SdkResolver\Microsoft.Build.NuGetSdkResolver.xml'. SDK resolver path: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtens
ions\Microsoft\NuGet\Microsoft.Build.NuGetSdkResolver.dll
As for the mono error, the MSBuild\15.0 folder exists but Microsoft.Common.props is not there (and I couldn't find it anywhere else on that machine).
As for the build tools error, the CommonExtensions folder exists but there is no Microsoft folder in it.
The command I'm trying is:
msbuild /p:Configuration=DEBUG /p:Platform="Any CPU" MonoAGS.sln
Why doesn't it work? What am I missing?
Thanks.
How to compile my c# solution with msbuild from command line
For the build tools error, you should install the component NuGet package manager by Visual Studio Installer:
When we use the Visual Studio build tool to build our project, we also need to install some of the necessary components for our project.
For the mono error, since I do not have mono ENV, I could not specify the directly reason for that error, if possible, you can try to install Mono framework. If it not helps, you can open a new thread with mono and msbuild tags.
Update:
How do I install it with command-line, btw (for setting up a script)?
Yes, you can use vs_buildtools.exe to install that component ID Microsoft.VisualStudio.Component.NuGet:
vs_buildtools.exe --add Microsoft.VisualStudio.Component.NuGet --quiet
Note: You should rename vs_buildtools__2048890300.15156xxxx.exe to vs_buildtools.exe, then use vs_buildtools.exe to install it.
Check the Visual Studio Build Tools 2017 component directory and Use command-line parameters to install Visual Studio 2017 for some more details.
Hope this helps.
I'm setting up a script that builds my C# solution from command-line. It works fine, but currently it runs MSBuild as 32-bit application and I want it to be ran as 64-bit.
Maybe I'm missing something obvious, but I can't find how to run MSBuild as 64-bit executable.
First I tried to use C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe, but this is wrong version.
So I found C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe which is version 14.0 (now I have both Visual Studio 2015 and Microsoft Build Tools 2015 installed), but it runs as 32-bit application (or I'm missing something)?
I expected to see some .exe in C:\Program Files where other 64-bit exes are stored, but nothing there.
My machine is 64-bit Quad Intel Xeon.
Maybe before calling MSBuild I should call some cmd-file to setup environment properly? Like vcvarsqueryregistry.bat?
Well, yes it was like in VS 2012 and VS 2013 in amd64 subfolder:
C:\Program Files (x86)\MSBuild\14.0\Bin\amd64\MSBuild.exe
I am trying to change the default installation directory of my projects when I publish them but I seem to have no choice over where the published setup.exe actually puts the program. It seems after setup.exe running and application installed, all the processed files are under the folder of C:\Users\{username}\AppData\Local\Apps\2.0\ (Something like that, I dont remember the exact directory as it is very long). This is not what i want as I installed the program in the C:\Program Files\ but all the log files go to the C:\Users\{username}\AppData\Local\Apps\2.0\. This is really really annoying.
The application I published is C# Windows Form Application
And I have looked through online and found that somebody suggested to create an MSI package for C# Windows Application Using a Visual Studio Setup Project instead of publishing the program:
Publish Windows form application how change the installation path
It is supposed that the above website can solve this problem. Are there any other suggestions to solve this redirection problem after publishing the C# Windows Form Application? Thank you.
When you use the Publish funtion in Visual Studio, you are creating click-once publication. This type of deployment has relatively fixed rules and not everything can be configured. It allways installs into an obfuscated folder under windows user profile. It is similar to the fact, that you cannot change location where windows-store modern apps are installed under Windows 8.1.
You can create MSI setup project for your app - but in Visual Studio 2012 this type of project is missing and it was re-introduced againg in Visuals Studio 2013. There you can specify install folder. You can also use Install Shield Lite with Visual Studio 2012.
You wrote:
This is not what i want as I installed the program in the C:\Program
Files\
It is not possible to install ClickOnce application using Publish button in Visual Studio into C:\Program Files\.
If you have just problem with the location of your log files, you need to specify a different folder within your application code. Make sure that user, who is running your app, has write access to that folder - it should be in some user's profile folder or in a public folder. Avoid %ProgramFiles% as a folder for your log files - it is not a good practice.
Instead of Application.StartupPath you should use path accessible to all users including non-admin, like:
Path.Combine(Environment.GetFolderPath(SpecialFolder.CommonApplicationData),"MyCompanyName")
You can use InstallShield to create installation wizards/Setup.
Here's the free version for Visual Studio
I've created the installer for my project without a problem, In project's properties, I included Visual C++ 2017 Runtime Libraries (x64) 2010 and 2017.
But during the installation in the client host, I've got a 'The following package files could not be found:' without specifying much more information.
Is when I checked the temp directory that I've discovered that 'vc2017redist_x64' haven't copied.
With the 2010 version, it seems to work rightly.
Anyone have experienced the same problem?
I'm using Visual Studio 2017 15.9.17.
Finally I came up with the solution.
The path of the VC++2017 installer in the default bootstraper package was wrong and installation failed.
So I had to edit the manifest file in
C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\ and set the right path.
Once modified, it worked!
Please notice that you can also find the bootstrapper folder location from the Path value in the following registry key:
HKLM\Software\Microsoft\GenericBootstrapper
On 64-bit systems, use the following registry key:
HKLM\Software\Wow6432Node\Microsoft\GenericBootstrapper