Need help finding a dll - c#

I just want to use HttpUtility.UrlEncode(myString). The project is .NET 3.5. But I can't find the corresponding dll. In .NET 4.0 it seems to be in System.web. But I'm not sure where it's located for 3.5
Can someone show me where I can download the corresponding dlls?
(And also, I would really prefer it if I don't need to download an installation package, since that ususally results in GAC-ing the stuff. I hate when stuff gets GAC-ed, it just increases the risk of not catching missing references after deploying in an environment where the installation package hasn't been run.)
(Why is it always like this with .net? ...So hard to find the proper dll. With java I don't remember it being that tricky to find the right jar file. But with .net it's often a mystery which update, framework installation etc things are located in)
edit:
Ok, this is embarrassing, I thought the assembly was missing from my framework... but turns out it was in the "add reference" list all along, it just wasn't sorted on the name column of the component. ...thanks.

Still System.Web according to http://msdn.microsoft.com/en-us/library/system.web.httputility(v=vs.90).aspx
Namespace: System.Web
Assembly: System.Web (in System.Web.dll)
Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0
You don't need to worry about downloading or installing anything in the GAC, as it's already part of the framework. If you have the relevant .NET framework installed, it'll be there.

I thought of marking this post down as the answer could have been found by simply Googling the class and method. It's not difficult at all to find it. You search MSDN for the class name and it will tell which assembly and which namespace support the class. In fact it's right here:
http://msdn.microsoft.com/en-us/library/1e55w41w.aspx.
Give me .NET over Java any day. VS works out of the box first time. Java doesn't. Having to spend days, possibly weeks getting the development environment set up, and then scrounging what components I can to produce something that takes twice as long to develop, is not my idea of a pleasant experience.

Related

.NET targeting multiple frameworks in VS2017. How to get IDE to target specific preprocessor directive?

I am creating a class library and have it targeting multiple frameworks. In this case .NetStandard 2.0 and .Net Framework 4.5. I want to write code specifically for .NET 4.5, but it's always greyed out and I get no intellisense. How to I tell the IDE I want to work on .NET 4.5?
I see you can change this, but it doesn't change how the IDE reacts (I know this is for running the app, but I thought I'd give it a try):
It's probably a stupid question, but I can't find anything online about targeting a specific framework in the IDE. Thank you.
bah. I found it. It's right under the tab of the CS file you are working on:
I knew it was a stupid question. But I wasted over an hour looking for this setting.

Why does downgrading my framework version and then upgrading again allow this .dll to load properly?

I am trying to automate some data collection using an Oscilloscope. I have a USB scope with plenty of examples. The examples worked just fine, but when I tried to create my own project things stopped working. I have mirrored their setup with respect to the .dll location and which is referenced in the project. Whenever the program tried to access any part of their .dll I continue to get
An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)".
There is however, nothing wrong with the .dlls. They are copied and pasted straight from the examples.
After changing a single variable many times over I found out how to fix the issue, at least in the short term. I found that I was targeting a different framework than they were. They target 2.0 and I was targeting the current 4.6.1. The page linked above says it should work with .NET 2.0 and newer. So I downgraded my project to 2.0 and now I do not get an exception when interacting with the .dll. Then if I upgraded to 4.6.1 it would continue to work.
My question is why, if possible to explain without their source code, does downgrading and upgrading again fix the issue?
Also, does this "fix" pose any long term issues that I need to be aware of?

WebServices on Unity, Dll, compatibility with .Net 4.0

I'm trying to use web services on unity.
I used svcutil to generate a proxy class, however the proxy class was using "System.Threading.Tasks".
I noticed that System.Threading.Tasks wasn't aviable on .Net 3.5.
So I went to player setting and I changed to .Net 4.x
But now I have an other issue, and I cannot find a way to fix it, I need to use System.Web.dll and System.Web.Services.dll to make my web service work, however, the dll that are include in Program Files\Unity\Editor\Data\Mono\lib\mono\2.0 are all targets for .Net 3.5.
So that mean I cannot use them on .Net 4.x
I've been looking for quiet long and was unable to find any answer.
I can add the code to the proxy class here if it's require, but I don't think it would be useful. Should I download those dll somewhere?
Anyone ever seen thoses issues somewhere?
You are using the wrong dll version.
Once you change Api Compatibility Level to Net 4.x, you have to copy the System.Web.dll and System.Web.Services.dll files from <UnityInstallationDirectory>\Editor\Data\MonoBleedingEdge\lib\mono\4.5 to your <Project>\Assets path.
That's it. Restart Visual Studio and Unity.
There is another method of linking missing libraries as described in this unity documentation.
Create a file called csc.rsp and put these 2 lines in it:
-r:System.Web.dll
-r:System.Web.Services.dll
And yes, you better set compatibility level to .NET 4.x
You also might want to restart Unity or VS in some cases.

Saxonica 9.7 HE in C#

I'm trying to get Saxon 9.7 HE up and running in C#, and failing miserably.
As per instructions, I am downloading and running https://sourceforge.net/projects/saxon/files/Saxon-HE/9.7/SaxonHE9-7-0-14N-setup.exe/download
This installs a bunch of files into C:\Program Files\Saxonica\SaxonHE9.7N.
In the bin folder inside this one, the following files are present:
No matter which DLLs I add as references to my project, the "using Saxon.Api;" reference fails to resolve.
Am I using the correct DLLs here? Is it some sort of .Net version mismatch? My class library project is set to .Net 3.5 currently.
Thanks for any help
The minimum supported version of .NET for Saxon is indeed 4.0.
The bug is in the documentation which will be updated shortly: See bug issue: https://saxonica.plan.io/issues/3085
Thanks for reporting the issue.
Some guess work here. But the dependency on .net 4 is most likley from the compiling of the C# wrapper over the saxon java library that was converted using IKVM. IKVM says it only requires .net 2.0, so I think the only place that dependancy can come from is the saxon9he-api.
You should be able to build this yourself, its quite thin.
https://dev.saxonica.com/repos/archive/opensource/latest9.7/hen/csource/api/Saxon.Api/
Otherwise if its a show stopper ask Michael Kay (the author), he's pretty active on stack overflow.
Updated
I was curious so I checked, the .Net 4 dependency seems to come from the saxon9he-api (which i'm fairly certain could be re-compiled under 3.5 with no/minimal changes), the same for the Query and Transform exe's.

pointing to use a different assembly for specific application c# forms/mvc

I using new Amazon SDK that uses their latest dll. I can't replace the existing (old) referenced assembly/dll because some the old applications are based on it and most its functions are already depreciated. My colleagues never updated their applications. My problem applies to all other applications not just the one's that uses amazon but oracle,ajaxtoolkit,EF, so on and so forth. I always develop my application with the latest assemblies and every time I pushed it to production some applications would fail. I'll be lucky if redirecting it to a newer version can make it work but most of the time I have to recode and use the old assembly which I am not a fan of. Is there a way that I can point my application to use different dll or bin location? I am seeing some codebase config in web.config but I'm not sure about it.
I really need this..Every time I tell them to update their application and library they always complain..I can't do anything they are my seniors here.
Thank you in advance
You can try bindingredirect in web.config, although this works when you have multiple versions of same assembly. Not sure if it can help in your case.
See various examples here - https://msdn.microsoft.com/en-us/library/7wd6ex19(v=vs.110).aspx

Categories