❔ System.Net.HTTP missing
Hey there, I'm writing something that needs HTTP requests, but when I try to use it, it says System.Net doesn't have the namespace:
The type or namespace name 'Http' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [CSharpDll]csharp(CS0234)
Is there a certain platform or version I need to target to get it to work? My CSProj begins like <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
, and I need to keep it like that. Do I have to find a workaround?46 Replies
This looks like the old project style?
What's the .NET version you're using?
Latest but it's based on a template from the web
er, 7.something
Show the whole csproj
that is a .net framework, old-style project file
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
It's an old version of an old version of .NET
It's old squared, there's no
System.Net.Http
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
so what should I do instead
tebeco#0205
<Reference Include="System.Net.Http" />
Quoted by
<@!85903769203642368> from #System.Net.HTTP missing (click here)
React with ❌ to remove this embed.
Try this
The primary reference "System.Net.Http", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "System.Net.Http" or retarget your application to a framework version which contains "System.Net.Http".
darn. I guess I'm out of luck
The app I'm making a plugin for says If using C# or VB.NET, you need to target .NET 4.0 client profile and for all interfaces note that MusicBee runs in 32-bit mode on 64-bit machines
You can use HttpWebRequest
which exists in .net fx 4
and if the request u need to make is simple enough u could even use webclient
that is assuming you are not able to bring in the System.Net.Http dll with your project
if u can u could install it using nuget
I just need to get the html from a web page
Try using a
WebClient
maybe?
Instead of the modern and proper HttpClient
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
i have to use it, musicbee is on .net 4
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
yeah, a plugin
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
oh, hm
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
i'll ask. What's the latest .NET version? Is it 7?
yes
there was a hard split between 4 and 5 thou, where 5 is based on .NET Core which was a rewrite to make it multi platform
we've also dropped the word "Framework" from the name
i just downloaded a plugin and it's in .net fx 4.8
so
.NET Framework 4.8
is a thing, and .NET 7
is a thingfwiw
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I'm sorry, all the nomenclatuire for dotnet and core anf c# versions are very confusing to me
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
that's what im quoting here
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
when was System.Net.Http added?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
just a suggestion
why not target .net standard and call it a day?
2.0
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
i told u i downloaded a plugin and it was 4.8
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
ah okay
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
leave it here for posterity
i am not going to use a rest api or rewrite the entire api lmao
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
yeah, that's probably an insane workaround
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
i was considering using the plugin to host a python/ruby process that would do what I wanted but I want to avoid doing that because it requires too many external dependencies and there's a lot of room for error
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.