F# NetStandard 2 Sytem.Net.Http name space missing - dll

I am new to F# and I apologize if this question was asked before, but I could not find it.
I am trying to create an F# DLL in NetStandard 2.0 and I would like to use HttpClient
open System.Net.Http does not work: The namespace 'Net' is not defined.
I looked and could not find any solutions specific to F# and HttpClient in the context of NetStandard 2.0
The name space System.Net.Http is there on the C# side using in NetStandard 2.0. No problem there.
On F#, intellisense does not show the .Http namespace when expanding System.Net
Any ideas would be greatly appreciated.
TIA,
David

That namespace is an assembly that is not automatically referenced as part of .NET, so it needs to be referenced for each project that uses it. It's possible that the C# project already had the reference, or your tooling added it automatically when you tried to open the namespace. So you just need to add a reference to the DLL "System.Net.Http" in your F# project.

Related

VB.Net 5.0 Core Console Application - System.Configuration (and My.Settings) unavailable

I need to set some persisting configuration info for the console app I'm writing with VB .Net Core (.Net 5.0).
Acc. to the documentation, System.Configuration should do the trick but Visual Studio goes: Imports statement unnecessary, and the My namespace only has InternalXmlHelper. My.Settings is simply non-existent.
I've tried to read the documentation and yesterday searched all over for anyone with similar issues but have found nothing so far.
Some help would be appreciated. :')
Edit: I've also checked to see if adding System.Configuration.dll as a reference is possible, and it is also unavailable.
Edit Conclusive: Found out that .Net Core does not support System.Configuration. Nevermind then. Hope I can find an alternative.

Cant add standard .Net references to project

How to add standard .Net references such as
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
When trying
using (System.Drawing.Image I)
I get the error
Severity Description File Line
Error The type name 'Image' could not be found in the namespace 'System.Drawing'. This type has been forwarded to assembly 'System.Drawing.Common, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcdxxxxx' Consider adding a reference to that assembly.
When going into reference VS 2018 wants me to point to the DLL File.
Its really frustrating. This is a Asp.NetCore MVC web based project.
System.Drawing is incompatible with .NET Core, because it uses Windows-specific APIs not available in .NET Core. Microsoft has since released System.Drawing.Common, which is a NuGet package that provides a similar API to the old System.Drawing but uses cross-platform APIs. To make this truly a drop-in replacement, the System.Drawing namespace now forwards to System.Drawing.Common, so older code could work without change.
Long and short, you need to add the System.Drawing.Common NuGet package to your project.

VS2015 C++ DLL and such with Add Reference

I have three VS2015 projects (DLL, C++ App & C# App)
I created the DLL and targeted v4.5 Framework
I created the C++ Application and targeted the v4.5 framwork and then was able to add reference without an issue.
I create the C# Application and targeted the v4.5 framework and then the Add reference fails with check your assembly or COM message.
Both applications have the DLL project added to the solution.
What else can I check as to why my C# process can't add reference?
Thanks,
Mark
I got around it using PInvode and the C# project didn't need to Add Reference afterall. I had to manually edit out the Precompiled header stuff to force that NotUsing. Thanks for the quick response... just had a quick turn around for my boss. Handed a working Cipher DLL for use with both C++ and C# in his project.

VB.NET DLL not possible in a Xamarin.Forms app?

I'm trying to reference a VB.NET DLL in a Xamarin.Forms (Portable) application. During the course of my research, I found the following post that might allow this: Xamarin.Android and VB.Net Libraries
I've tried to use the "Embed" work-around mentioned in the link, but the Xamarin.Forms project would fail to build because it can't load the Microsoft.VisualBasic assembly, version 8.0.0.0.
I've also found the following link as well during my research that should allow at least some VB.NET usage in a Xamarin application: https://developer.xamarin.com/guides/cross-platform/application_fundamentals/pcl/portable_visual_basic_net/xamarin-forms/
At the bottom of the site, there is a "Limitations of VB.NET in Xamarin.Forms" section. With the last item: "Xamarin does not support the Visual Basic.NET language," does that simply mean that you can't use a VB.NET dll in any Xamarin.Forms (portable) project that happens to also reference Xamarin.Forms.Core, Xamarin.Forms.Platform, and Xamarin.Forms.Xaml?
Thanks for any insight!
A DLL doesn't contain it's dependencies. If your DLL relies on Microsoft.VisualBasic, you will need to load the DLL that contains that assembly as well.
So either remove the Microsoft.VisualBasic assembly reference from the VB DLL, or include it as a reference in your Xamarin project (which may or may not be possible, I am not sure.)

Missing System.Security.Cryptography

I want to use the HMACSHA1 class in a project but the namespace System.Security.Cryptography is missing. If I add the reference System.Security, I find the namespace Cryptography but without the class HMACSHA1. And I can't find the namespace Windows.Security.Cryptography which seems to replace System.Security.Cryptography.
My projet targets the framework .NET 4.5and the .NET for Windows Store apps and He use Nuget on Visual 2012 on Windows 7.
Someone have a solution to this problem ?
According to the MSDN entry on HMACSHA1
There's no information that it is included in the Portable Class Library.
BUT: there's Portable Class Libraries Contrib out there, which includes a port of HMACSHA1
I had what sounds like a similar problem in a newly created C# console application. By default System reference showed some of System.Security, but not any of the Cryptography stuff. I had to right click 'References', 'Add Reference' and select 'System Security' after which I had access to the Cryptography stuff.
I'm fairly new to C# so sorry if my description isn't up to snuff or if this solution doesn't apply to mobile apps. Maybe helps someone else. thx