Microsoft.Data.Schema.SqlTasks.targets" was not found - azure

Wanting to build a Pipeline to generate a dacpac from a database solution. But the build fails with this error message
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets" was not found.
Running this on a self hosted agent, I installed SSDT tools along with VS2017 but the file that was added was "Microsoft.Data.Tools.Schema.SqlTasks.targets" <-- note the "Tools" ; so basically the build still fails.
Will appreciate guidance. Thank you all in advance.

Related

Unable to build Compiled Azure Function in VSTS (Error MSB4019)

I have created an Azure Function using the latest build of visual studio 2017 (15.3.1).
This build allows me to do the:
New Project > Azure Function App approach
This produces a .csproj (not a .funproj file) and it's doesn't come bundled with a website or anything. I've tried .Net 4.6 and 4.6.1 as the target framework and neither have worked.
I get the following error in VSTS:
C:\Users\Builder.nuget\packages\microsoft.net.sdk.functions\1.0.2\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Publish.props
(13, 3)
C:\Users\Builder.nuget\packages\microsoft.net.sdk.functions\1.0.2\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Publish.props(13,3):
Error MSB4019: The imported project "C:\Program Files (x86)\Microsoft
Visual
Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\Sdk\Sdk.Props"
was not found. Confirm that the path in the declaration is
correct, and that the file exists on disk.
There is no node in my .csproj file so I am not sure where it is getting that from.
I'm using the latest NuGet option in VSTS, I'm using the Latest VS Version option as well.
The build steps are:
Get Sources
NuGet Restore
Build Solution (MSBuild.exe exited with code '1' every time)
Is there any way to build (and then release) compiled .Net functions in VSTS at the minute?
I was able to solve this by swapping the build agent from the "Default" group to the latest, "Hosted VS 2017" group, and that has compiled fine.
Looks like the machine is missing the latest dotnet cli. I'm not too familiar with VSTS build machines, but you'd need to get that on there somehow https://www.microsoft.com/net/download/core

Running node.js tests locally in vstest.console.exe gives ... Error: An exception occurred while invoking executor 'executor://nodejstestexecutor/v1

I'm trying to get VSTS to run my Mocha unit tests, similar to how I've got them running in VS 2017.
I'm installed the Node JS Tools for Visual Studio and VS Test Explorer (after a restart) picks up the tests, and runs them.
But I can't get a VSTS build task to run them ???
Tried going through the notes on NTVS about running tests in VSTS but no joy getting it to work.
Moved onto the section about troubleshooting, and seeing if I can run the tests using my local vstest.console.exe ...
So far trying to run vstest ...
Error: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0\Node.js Tools\Microsoft.NodejsTools.targets" was not found
quick fix ... added a copy of directory ... C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Node.js Tools ... to ... C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0
Error: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" was not found
quick fix ... added a copy of directory ... C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets ... to ... C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0
Error: Could not find a part of the path C:\Repos\smc\BasicAzureExpress\BasicAzureExpress\ntvs\TestFrameworks
quick fix ... amend .nsproj to VS 2017 ... <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion> and a directory \TestFrameworks under \ntvs
... and then have the error ... Error: Missing generic test framework
So I'm left puzzled as to why VS 2017 can run the tests, but vstest.console.exe won't
First, the VSToolsPath value is empty if running in command line, then uses $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) path, but there aren’t necessary files of nodejs tool.
You can modify it like this (change Community to Professional if you are using vs2017 Professional):
<!--<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>-->
<VSToolsPath>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0</VSToolsPath>
Secondly, refer to these steps to run test on Hosted VS 2017 agent.
Modify project file (njsproj)
:
<!--<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>-->
<VSToolsPath>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0</VSToolsPath>
Copy NodeJsTools content in C:\Program Files (x86)\Microsoft Visual Studio\2017[Community, professional or enterprise]\Common7\IDE\Extensions\Microsoft to your ntvs folder
Add these files to source control and check in changes
Queue build with Hosted VS 2017 agent.

MSBuild Tools 2017 with Azure SDK 2.9.6

Yep there are similar question out there, but they are not related to VS 2017:
Visual Studio Build - Azure 2.9 SDK
MSBuild MSB4096 error with Azure SDK 2.9.1
I've recently upgraded from VS 2015 to VS 2017. On my local dev computer everything works fine and the Azure application (with Azure SDK 2.9.6) builds and starts.
But on the TeamCity server (MS Build Tools 2017 - Tool version 15.0) I get the following error:
MSB4019: The imported project "C:\Program Files (x86)\Microsoft
Visual
Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\Windows
Azure Tools\2.9\Microsoft.WindowsAzure.targets" was not found. Confirm
that the path in the declaration is correct, and that the
file exists on disk.
The build server/MSBuild tries to find the Microsoft.WindowsAzure.targets in the directory:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\Windows Azure Tools\2.9\
But it is actually in the directory:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\[VisualStudioVersion]\MSBuild\Microsoft\VisualStudio\v15.0\Windows Azure Tools\2.9\
[VisualStudioVersion] can have the following values "Community", "Professional" ,"Enterprise"
Yes, I've the build tools installed (https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=15 ).
Yes, I already copied the whole Windows Azure Tools folder to BuildTools\MSBuild\Microsoft\VisualStudio\v15.0, but then I get another error in my F# project:
MSB4057: The target "GetTargetFrameworkProperties" does not exist in
the project.
It seems like the new MS Build Tools 2017 doesn't work properly with Windows Azure. Are there any workarounds yet? Or is the only option to switch back to an older MSBuild?
The new standalone BuildTools currently don't support Windows Azure targets.
So if you want to use the new MSBuild 2017 with Azure SDK you have to install a full VS 2017 installation on your build server.
Note: You may have to restart the TeamCity (agents) in order to recognize the MSBuild path. After running a build you can see the used MSBuild paths in the tab 'parameters':
MSBuildTools15.0_x64_Path: C:\Program Files (x86)\Microsoft Visual Studio\2017\[VS_VERSION]\MSBuild\15.0\bin\amd64
MSBuildTools15.0_x86_Path: C:\Program Files (x86)\Microsoft Visual Studio\2017\[VS_VERSION]\MSBuild\15.0\bin
[VS_VERSION] can be Community, Professional or Enterprise
I still got the GetTargetFrameworkProperties error from the F# project, this was resolved by adding the flag:
/p:VisualStudioVersion=15.0
to the MSBuild task.
For more information see https://github.com/Microsoft/msbuild/issues/1888

TeamCity FTP Publish

I am trying to build and deploy my project in team city. I get green but it does not publish project to FTP. What could be the problem?
Teamcity Build Step:
Publish Profile:
Buildlog of Teamcity:
Try the build step Visual Studio.sln, give the Solution file path , select the Visual Studio Version, select the Target as build;publish, select Configuration as release. Then run the program. You will get an error message. Then check the following link for a solution.
http://www.jayway.com/2011/03/20/configuring-automatic-deployment-of-a-windows-azure-application-using-teamcity/
I hope this would help you.

installing Help viewer without installing visual studio

I want to take some of MSDN help files offline on a windows machine which does not have visual studio installed on it. the problem is that I cannot find a way to get and install Help Library manager and Help viewer without installing the visual studio or sql server.
How can I install them without installing the visual studio or sql server?
I just wrote an answer on how to do this for an older question, which can be found here.
For convenience, here are the essential steps to get Help Viewer 2.2 to run without going to the trouble of installing a complete copy of Visual Studio 2015:
Most of the files required by HlpViewer.exe can be found on the Visual Studio DVD in two different MSI packages. By passing some additional command line arguments to msiexec, it's quite easy to install them manually:
msiexec.exe /i help3_vs_net.msi VS_SETUP=1
msiexec.exe /i vs_minshellcore.msi MSIFASTINSTALL="7" VSEXTUI="1"
While this installs most necessary files, it doesn't account for all of them ... to keep things simple, I copied the rest of them from a working installation on another computer:
C:\ProgramData\Microsoft\HelpLibrary2
Essentially only contains a CatalogType.xml and some empty directories.
C:\Program Files (x86)\Microsoft Help Viewer\v2.2\CatalogInfo\VS11_en-us.cab
Moreover, it's necessary to provide the application with a valid ContentStore path by importing the following .reg file:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Help\v2.2\Catalogs\VisualStudio14]
"LocationPath"="%ProgramData%\\Microsoft\\HelpLibrary2\\Catalogs\\VisualStudio14\\"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Help\v2.2\Catalogs\VisualStudio14\en-US]
"SeedFilePath"="C:\\Program Files (x86)\\Microsoft Help Viewer\\v2.2\\CatalogInfo\\VS11_en-us.cab"
"catalogName"="Visual Studio Documentation"
Finally, I created a new Application Shortcut and changed its Target: to read as follows:
"C:\Program Files (x86)\Microsoft Help Viewer\v2.2\HlpViewer.exe" /catalogName VisualStudio14 /launchingApp Microsoft,VisualStudio,14
Et voilà!, with that HlpViewer.exe should finally execute without any problems!
In MSDN to USB v2.5, you don't have to have any Visual Studio IDE installed:
https://stackoverflow.com/a/66595500/3268088
I know its old question. I just run into a problem involving Help Viewer.
my recovery steps are :
get sqlexress installer (if you haven't got one)
after extracting the files, check its folder and find for "help" folder
I got mine "SQLEXPRWT_x64_ENU\redist\VisualStudioShell\Help\x64"
run install.exe with administration priveleges (Run as Administrator)
all done.

Resources