# How do I install .NET Framework 4 SDK?

**URL:** <https://forum.ansible.com/t/how-do-i-install-net-framework-4-sdk/34549>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [February 1, 2021, 8:36am UTC](https://forum.ansible.com/t/how-do-i-install-net-framework-4-sdk/34549 "2021-02-01T08:36:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amedee\_Van\_Gasse](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@Amedee\_Van\_Gasse](https://forum.ansible.com/u/Amedee_Van_Gasse)\
**Post date:** [February 1, 2021, 8:36am UTC](https://forum.ansible.com/t/how-do-i-install-net-framework-4-sdk/34549/1 "2021-02-01T08:36:50Z")

</div>

Windows Server 2019, configured with Ansible.

I have tried with

- name: Install multiple packages  
win\_chocolatey:  
name:

- nuget.commandline

- nunit-console-runner

- visualstudio2017buildtools

- dotnet

- dotnetfx

- netfx-4.8

- netfx-4.8-devpack  
state: present

- name: Install dotnet core SDK 1.1  
win\_chocolatey:  
name: dotnetcore-sdk  
version: 1.1.14  
state: present  
allow\_multiple: yes

- name: Install dotnet core SDK 2.1  
win\_chocolatey:  
name: dotnetcore-sdk  
version: 2.1.510  
state: present  
allow\_multiple: yes

- name: Install dotnet runtime  
win\_chocolatey:  
name: dotnetcore-runtime.portable  
package\_params: /ShimDotnetExe  
state: present

but when running dotnet build foo.sln I still get

C:\Program Files\dotnet\sdk\2.1.510\Microsoft.Common.CurrentVersion.targets(1179,5): error MSB3644: The reference assemblies for framework “.NETFramework,Version=v4.0” were not found. To resolve this, install th  
e 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 th  
e 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.

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [February 1, 2021, 10:28pm UTC](https://forum.ansible.com/t/how-do-i-install-net-framework-4-sdk/34549/2 "2021-02-01T22:28:10Z")

</div>

This doesn’t really sound like an Ansible question, dotnet build is complaining it can’t find the assembly and that’s just what Ansible is reporting. YOu need to figure out the correct install steps first then you can do the same with an Ansible task.

---

<div class="post-metadata">

**Author:** ![Amedee\_Van\_Gasse](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@Amedee\_Van\_Gasse](https://forum.ansible.com/u/Amedee_Van_Gasse)\
**Post date:** [February 5, 2021, 12:54pm UTC](https://forum.ansible.com/t/how-do-i-install-net-framework-4-sdk/34549/3 "2021-02-05T12:54:59Z")

</div>

I don’t know how to figure out the correct install steps. My devs don’t want to help me, they dumped me on a web page with just a list of software they manually install with next-next-next-finish.

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [February 5, 2021, 1:38pm UTC](https://forum.ansible.com/t/how-do-i-install-net-framework-4-sdk/34549/4 "2021-02-05T13:38:20Z")

</div>

Ansible can automate the installation, but it doesn’t magically know what you want to automate. This is basically the effort that you have to put in.

I can’t make this more specific than that you need to write an ansible playbook with tasks to install that “list of software”.
