Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,370,157
Community Members
 
Community Events
168
Community Groups

Why does my CI build get an MSB4236 error?

A CI build on Windows 2012 server continues to fail with: 'error: MSB4236: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found.'

.Net Core 2.0 is installed correctly - c:\windows\system32> dotnet -- version returns 2.1.2

The Path environment variable contains both C:\Program Files\dotnet and C:\Program Files\dotnet\sdk\2.0.0\Sdks - and the SDK is present at that location.

Why does the agent fail to find the SDK?

Bamboo v6.5.0

1 answer

1 accepted

0 votes
Answer accepted

Hi @David FALLAS,

Let me share some troubleshooting tips that might help you moving forward:

  1.  First of all, check what part of the build is reporting this error:
    * What is the affected task?
    * It it is an script task, or a task that uses an external builder or script, check specifically what command is failing.
  2. Try to run the same command or actions performed by that task from your agent server terminal (no Bamboo involvement).
    * If it works, we need to check if the environment variables for your agent are the same of your terminal.
    * If it is not working you know there to fix things.
  3. Assuming your terminal works we need to know what is different when using Bamboo.
    * Check what are the environment variables from terminal in comparison with your agent JVM environment ones.
       ** Use the command SET to check the environment variables in the terminal
       ** Add a script task before the task failing in Bamboo to run the SET command. That will return the variables from inside the agent JVM. If the problem is here you will be able to check what is wrong.
    * Check if there is any capability missing in your server capabilities.
  4. Check if this is working for other agents
    * if it is working, what is different?

Try to cross the build logs with the agent logs to identify more details of what is causing the issue.
The agent logs can be found at:

  • <Bamboo_Agent_Home>/logs/atlassian-bamboo.log (application logs)
  • <Bamboo_Agent_Home>/atlassian-bamboo-agent.log (application logs + JVM logs)

Thank you Daniel - your response helped me investigate this in a more systematic way.

The underlying problem was due to changes to the path(s) to the MSBuild binaries and dependencies in the latest Microsoft Build Tools deployment. Some files that Bamboo could not find, and which were the root cause of my build problems, are now in C:\Program Files (x86)\Microsoft Visual Studio\2017\...

We only uncovered this after a number of other builds started to fail as well as my newly added one.

Hey David,

Great to hear!
I'm glad you could find what was causing the issue and fix it.

\o/

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events