Hi,@Thejesh Pushpala. Welcome to Microsoft Q&A.
After my test, when installing System.Net.Http through the NuGet package, I found that the similar versions are only 4.1.1 and 4.1.3, and I did not find 4.1.1.3. Please confirm whether the System.Net.Http version is correct.
The following is a case where I tested successfully. You can compare and modify it.
1.Create several programs
Class Library(.NET Framewrok4.6)
a.Install System.Net.Http 4.1.3 via Nuget package
b.Create a class and a method
public class Class1
{
public async Task<String> Fun()
{
HttpClient client = new HttpClient();
{
string responseBody = await response.Content.ReadAsStringAsync();
return "Class1"+responseBody.Substring(0,10);
}
}
}
Class Library(.NET Framewrok4.6)
a.Install System.Net.Http 4.1.3 via Nuget package
b.Create a class and a method
public class Class2
{
public async Task<String> Fun()
{
HttpClient client = new HttpClient();
{
string responseBody = await response.Content.ReadAsStringAsync();
return "Class1"+responseBody.Substring(0,10);
}
}
}
WPF App(.NET Framework4.8)
a. Reference the above two Class programs(Add references directly through References)
b. Using Class1 and Class2
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
Task.Run(MyFun);
}
public async void MyFun()
{
Class1 class1 = new Class1();
Class2 class2 = new Class2();
var str1 = await class1.Fun();
var str2 = await class2.Fun();
MessageBox.Show(str1+" : "+str2);
}
}
c. Build the project
2.Using WIX v3
a.Install Wax, WiX v3 - Visual Studio 2022 Extension in Extensions->Manage Extensions
b.Create a Setup Project for WiX v3
c.Use References to reference only WPF projects
d.Install wix 3.14.1 version via NuGet
e.Open the WiX Setup Editor (Tools->WiX Setup Editor)
f.Set the Root directory to INSTALLFOLDER
g.Check the current project in Projects to install
h.Select all in File mappings(Includes two Class Libraries referenced by the WPF project)
i.Modify the Manufacturer and installation file names in Product.wxs
Developer Name
Manufacturer="AAA"
Change the name of the installed folder to BBB
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="BBB" />
</Directory>
</Directory>
</Fragment>
i.Build the program
j.Install: Enter the current project folder, find the msi file in bin->Debug and double-click to run
k.Run the program in C:\Program Files (x86)\BBB
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.