Im following this github repo for setting up ci-cd pipeline for synapse using dacpac : https://github.com/santiagxf/synapse-cicd
In the github workflow for CI , AT BUILD DACPAC step , im getting following error :
Build FAILED.
/usr/share/azuredatastudio/resources/app/extensions/mssql/sqltoolsservice/Linux/3.0.0-
release.110/Microsoft.Data.Tools.Schema.SqlTasks.targets(1216,24): error MSB4057: The
target "BuildOnlySettings" does not exist in the project.
Im using SQL Database Projects plugin in Azure Data Studio to create the project. It by default uses .sqlproj .
Following is the dotnet details in teh github runner :
Version: 3.1.416
Commit: 8d3765c609
Runtime Environment:
OS Name: ubuntu
OS Version: 20.04
OS Platform: Linux
RID: ubuntu.20.04-x64
Base Path: /home/runner/.dotnet/sdk/3.1.416/
Host (useful for support):
Version: 3.1.22
Commit: 35fa579a30
.NET Core SDKs installed:
3.1.416 [/home/runner/.dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.22 [/home/runner/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.22 [/home/runner/.dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Microsoft (R) Build Engine version 16.7.2+b60ddb6f4 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
/usr/share/azuredatastudio/resources/app/extensions/mssql/sqltoolsservice/Linux/3.0.0-release.110/Microsoft.Data.Tools.Schema.SqlTasks.targets(1216,24): error MSB4057: The target "BuildOnlySettings" does not exist in the project.```
I have also tried using dotnet 5
Hopefully you've resolved this issue by now, but in case someone else is searching for a resolution for this issue, I believe this is probably what you're missing in your .sqlproj file:
SQLProj file example with Build Target and other properties illustrated
If you open your .sqlproj file in a text editor you'll see the properties of that file. You should have an XML element named "Project" with a property and value of "DefaultTargets="Build" It would look like this:
enter code here
I tried to add the code for my entire .sqlproj as there are some other important elements to consider when building from Azure Data Studio, especially regarding references to master database, sqlCMDVariables, etc...but I don't post here much at all and the whole "insert code here" thing is super wonky and I don't care to spend an hour trying to figure out how to use it, so...whatever. If there's enough interest I'll figure it out later, but the image will have to do.
Hopefully this helps someone.
You'll also see the (usually required) reference to Master Database for any builds, as well as the "Configuration Condition=" within the property group element. That's another important thing to have if you're building using a yml file since you need to explicitly declare your dotnet build in the CI pipeline and all that.
Related
I'm learning Azure functions, and after setting up an initial project the tutorial suggests to select Project > Add new Item > Azure function.
On my end, I don't see Add New Item in the menu, but if I right click on the .csproj file I see add new item, however, I don't see an option for adding an azure function.
Expected behavior (screenshot from tutorial)
Actual behavior on my end:
I checked this post where it says to add "Azure Functions and web job tools" though I don't see that as an option on my side.
Also referenced this post:
Missing Azure functions template under Add new item in Visual Studio
It recommended making sure I have the Azure SDK workload (which I do) and installing this SDK: Microsoft.Net.Sdk.Functions
I went to my folder and ran this command so as far as I know it's installed at this point.
dotnet add package Microsoft.NET.Sdk.Functions --version 4.1.3
This is my current file structure and .csproj file.
When setting up VS, I selected Azure SDK as a workload. Also, if I go to File > New > Project, I have an option for Azure functions.
Any insight as to why it's not showing up for me would be appreciated. If you need me to clarify anything, please let me know.
As you have followed one of my practical workarounds #7004818, make sure you have done the below configuration:
Download & Install the Azure Functions Core Tools, VS 2022 Current Version 17.4.4
In Visual Studio installer, Select the below options:
- Web & Cloud: ASP .NET & Web development, Azure Development
- Desktop & Mobile: .NET Desktop development
- Other toolsets: Visual Studio Extension Development
You are developing the Azure Functions in .NET So, install the respective Version SDK & Runtime.
On the Same above Post, the user #GraceA added a point to my answer which is to check the NuGet Package Source Install/Update is missing and there are steps given in the answer for updating/installing it.
[VS NuGet Package Update Gif Image1]
[VS Azure Functions Toolset Update Gif Image 2]
The Same issue registered on MS Q&A Forum #386611 where the user has resolved it by updating the NuGet Package Source.
I'm using Azure 2.7.
I created a C# cloud service that only contains a single worker role. After it's done, the solution contains
A ccproj
A csproj
Both are using the setting of AnyCPU.
I then added the PropertyGroup "Debug|x64" and "Release|x64" into both projects. Also changed the default to x64 for both. As a result, an x64 build.
However, whenever I select "publish" on the "ccproj", I notice that it always builds AnyCPU instead of x64. I cannot find how to force it to build x64 for packaging and deployment.
I then edited both proj file again, and removed the PropertyGroup for "Debug|AnyCPU" and "Release|AnyCPU". After I did this, and when I tried to build x64 again, I got error as:
C:\Program Files
(x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(723,5):
error : The OutputPath property is not set for project
'AzureWorkerRoleExample.ccproj'. Please check to make sure that you
have specified a valid combination of Configuration and Platform for
this project. Configuration='Release' Platform='AnyCPU'. This error
may also appear if some other project is trying to follow a
project-to-project reference to this project, this project has been
unloaded or is not included in the solution, and the referencing
project does not build using the same or an equivalent Configuration
or Platform.
I could not figure out how to work around this error.
Any idea on how to force VS to make a x64 build of cloud service and deploy it?
One workaround I found is that: keep AnyCPU property groups, but also put
<PlatformTarget>x64</PlatformTarget>
in the group. Thus the AnyCPU assembly are actually targetting to x64. But this sounds hacky.
Any idea?
Thanks a lot!
I have setup my .NET project in TFS Build. It builds fine locally, but I am getting this build error on the server:
The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
I have no idea what it is, even googling didn't help much. My solution has some database projects. What is the issue here and how I can fix it?
You need to install the SQL Server Data Tools on all build agents. When installing a TFS Build server, people often create agents to be on that or other machines.
You can download them from the MS SQL Server Data Tools Blog or Microsoft SQL Server Data Tools, and you choose the one that corresponds to the builds that you doing (Visual Studio 2010 or Visual Studio 2012).
Note: In some cases, the error mentions the path:
c:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets
In such cases, install SQL Server Data Tools from SQL installation, not the link above.
I have solved a similar issue by adding a new Solution Configuration that does not build the SQLPROJ. I then configured CI-CD (Azure DevOps Pipelines) to build that configuration.
In a subsequent step of the Build, I exclusively build and pack the SQLPROJ. By thisI avoid having two Solutions - one of which will only have on project; the SQL Project.
For quite a while already we use ReadyRoll.MSBuild NuGet package. Event that ReadyRoll is not ReadyRoll anymore, it is still being regularly updated and keeps working with most recent SCA addins. It contains same build extensions, and works flawlessly on our build agents without need to install anything. Biggest problem is absence of nuget support in .sqlproj files, which makes adding/updating packages bit tricky: https://documentation.red-gate.com/rr1/installing/build-components
SQL Change Automation documentation doesn't contain this section, so it's hard to say for sure how long will it stay the way it is.
For the sake of completeness, properties to add to your .sqlproj as of today:
<ReadyRollNuGetBaseFolder>$(MSBuildThisFileDirectory)..\packages</ReadyRollNuGetBaseFolder>
<ReadyRollNuGetIsRestored Condition="$([System.IO.Directory]::GetDirectories($(ReadyRollNuGetBaseFolder), 'ReadyRoll.MSBuild.*').Length) != 0">True</ReadyRollNuGetIsRestored>
<SqlChangeAutomationTargetsPath Condition="$(ReadyRollNuGetIsRestored) == 'True'">$([System.IO.Directory]::GetDirectories($(ReadyRollNuGetBaseFolder), 'ReadyRoll.MSBuild.*')[0])\tools\ReadyRoll.Data.Schema.SSDT.targets</SqlChangeAutomationTargetsPath>
If this problem occurs on Azure DevOps pipeline build agent, then please use MSBuild#1 instead of DotNetCoreCLI#2 in the pipeline YML task. It worked for me.
- task: MSBuild#1
displayName: 'Build SQL solution'
inputs:
solution: <SQL DB Solution>.sln
msbuildArchitecture: x64
msbuildArguments: '/property:DSP="Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider"'
configuration: 'release'
I was just upgrading my project from sdk 1.3 to 1.7 and I noticed that now when I build the application the package(cspkg) is not created with the build. I have go click on publish to create a package. Is there a way to tell VS to create a package everytime a build is triggered.
Also using msbuild is there a way to do the same thing. I have multiple projects under a solution, Most of which are just libraries and then there is this azure app. Is there a way to specify a single msbuild statement with params to tell the azure app to create the package as well as build the other projects. Also when I specify debug the debug package should be created and when I specify release switch the release package should be created.
How could I do the same thing on my build server as well where I have a .proj file which specifies the sln to build. How could I mention a switch to build the package there.
Thanks,
Kunal
You can configure CSPACK command (Be sure to have CSPACK.exe launched from SDK 1.7 Path otherwise you will get some schema related errors with SDK 1.6 project) as Post Build event in your Windows Azure Application Build settings. This way when you will build, after successful build CSPACK command will run and package your application. Same way you can configure your MSBuild configuration. I just tested and it worked for me.
Visit this MSDN article on packaging a cloud service to learn more.
You can do this using msbuild as well. See the Resolution section of this question.
I am trying to deploy a Visual C++ application (developed with Microsoft Visual Studio 2008) using a Setup and Deployment Project. After installation, users on some target computers get the following error message after launching the application executable: “This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem.” Another user after installation could run the application properly. I cannot find the root cause of this problem, despite spending several hours on the Visual Studio help files and online forums (most postings date back to 2006). Does anyone at Stack Overflow have a suggestion? Thanks in advance. Additional details appear below.
The application uses FLTK 1.1.9 for a GUI library, as well as some Boost 1.39 libraries (regex, lexical_cast, date_time, math).
I made sure I am trying to deploy the release version (not the debug version) of the application. The Runtime library in the Code Generation settings is Multi-threaded DLL (/MD).
The dependency walker of myapp.exe lists the following DLLs: wsock32.dll, comctl32.dll, kernel32.dll, user32.dll, gdi32.dll, shell32.dll, ole32.dll, mvcp90.dll, msvcr90.dll.
In the Setup and Deployment Project, I add the following DLLs to the File System on Target Machine: fltkdlld.dll, and a folder named Microsoft.VC90.CRT with msvcm90.dll, msvcp90.dll, mcvcr90.dll and Microsoft.VC90.CRT.manifest.
The installation process on the target computers getting the error message requires having the .Net Framework 3.5 installed first.
Any suggestion? Thanks in advance!
Add the Visual C++ Redistributable to your Deployment project and be sure to run Setup.exe instead of the MSI when installing. This will invoke the VCRedist bootstrapper to ensure your PC has those pieces before installing your app.
Dependency Walker only shows static (link time) dependencies - it cannot possibly know about dynamic dependencies such as COM objects.
I had a similar problem after the ATL security updates last year. My app needed a later version of the C++ runtime libraries than the deployment project included.
Try running Windows Update on the target machines after installation, or download and install the latest (28 July 2009) C++ redistributable package directly.
http://support.microsoft.com/?kbid=973551
That solved the problem for me. I haven't fixed the deployment project yet though.