Missing DotNetOpenAuth.ApplicationBlock in OpenID+OAuth - c#

I am implementing OpenID+OAuth in my ASP.NET WebForm (using .NET Framework 3.5) application, found example on net
https://groups.google.com/forum/?fromgroups=#!topic/dotnetopenid/xQYkE6sUZYU
But I am missing DotNetOpenAuth.ApplicationBlock namespace, I included these libraries in my project:
DotNetOpenAuth.dll
DotNetOpenAuth.OAuth2.dll
DotNetOpenAuth.OAuth2.Client.dll
Can any one suggest me where I am doing wrong?

The ApplicationBlock is not distributed in binary form as it is intended for copy+paste of relevant source code into your project. You can get the ApplicationBlock project from the samples distribution on SourceForge.

You can find the project under the DotNotOpenAuth folders at Samples/DotNetOpenAuth.ApplicationBlock

Related

Asp.Net WebForms .Net Fwk 4.6.1: Can't find System.Web.Helpers.AntiForgery library

I have a Asp.Net (4.6.1) WebForms project, and I'm trying to implement the AntiForgery prevention like the Microsoft documentation.
The thing is that I'm not able to find the library to install and allow me to implement that, like this:
<%= System.Web.Helpers.AntiForgery.GetHtml() %>
It is showing me an error saying that the "Helpers doesn't belong to this namespace"
Could you guys help me please?
You need to learn how to get the necessary information from the documentation. In particular, you need to search the reference docs of the class: just Google for System.Web.Helpers.AntiForgery.
You'll find the MSDN page:
https://msdn.microsoft.com/en-us/library/system.web.helpers.antiforgery(v=vs.111).aspx
In that, you can read the Assembly: System.Web.WebPages.
So, basically you need to add a reference to that assembly, in order to have your project access the corresponding class.
In Visual Studio, you accomplish that right clicking on the project or on the Reference element and selecting "Add Reference..." for framework assemblies (or for your projects); or, you "Manage Nuget Packages" from the same menu and install the appropriate packages from Nuget. Speaking of Nuget, it's the package management solution for .NET and it's great, but it's for another question.
In your case, I think you will need a Nuget package called microsoft-web-helpers.
https://www.nuget.org/packages/microsoft-web-helpers
Edit: I just looked up the docs and noticed that the documentation relates to WebMatrix. You're talking about WebForms: I don't think the two are compatible, AFAICT.

I want to get codebehind from published .net webforms project

I accidentally formatted the disk that contains my .net webforms project. I only have published one. Now I want to get c# codes from published project. Is this possible?
You can't get the exact code, but you can use some softwares that 'decompile' the dll. I call this reverse engineering.
Personally I use ILSPy, heres ILSPy GitHub Repository: https://github.com/icsharpcode/ILSpy
Hope this works for you! Thx

Swagger.NET MVC Api Exception

I've been looking at different options for providing auto generated API Documentation and Swagger seems to be up there.
However when trying this out for the first time I'm getting exceptions on start up.
Running Visual Studio 2013.
Create new Web API project.
Using Package Manager, run:
Install-Package Swagger.Net & Install-Packager Swagger.Net.UI
Making sure we've enable the XML documentation we get this exception:
Method 'GetDocumentation' in type 'Swagger.Net.XmlCommentDocumentationProvider'
from assembly 'Swagger.Net, Version=0.5.1.0, Culture=neutral, PublicKeyToken=null'
does not have an implementation.
Does anyone else know of a step we are missing? We found & followed this:
https://github.com/Swagger-Net/Swagger.Net/wiki
https://github.com/Swagger-Net/Swagger.Net/blob/master/README.md
Swagger doesn't support .NET 4.5 - Had to get the source code out from git and modify it to work with 4.5.
Right click the project and set the target framework in there
I have made a library for use with mvc that generates the documentation for you based on attributes. It may be what your looking for.
MVC3: https://www.nuget.org/packages/SwaggerAPIDocumentation/
MVC4: https://www.nuget.org/packages/SwaggerAPIDocumentation.Mvc4/
MVC5: https://www.nuget.org/packages/SwaggerAPIDocumentation.Mvc5/
MVC5.1: https://www.nuget.org/packages/SwaggerAPIDocumentation.Mvc51/
There is dcoumentation in the repository on github just click the project site link. Hope this helps
Try using Swashbuckle.
Based on Swagger as far as I know and it worked first time for me...
https://github.com/domaindrivendev/Swashbuckle

Microsoft.Test.CommandLineParsing which dll is this in

I have recently inherited a c# .net v4 project from a former colleague which contains the following declaration:
using Microsoft.Test.CommandLineParsing;
I have search google and our entire repository tree for this but cannot for the life of me find the required DLL for this.
The part "Test" is the bit which is not being found so I assumed there was a Microsoft.Test.dll - No such luck!
Can someone enlighten me as to which MS DLL I need to reference in order for this to be used.
Thanks,
Gary
That namespace is from the TestApi project.

Namespace 'SharePoint' does not exist in the namespace 'Microsoft'

So I am starting to learn C#, like literally just started learning, and coming from a Java background, it doesn't look too bad. However, I have a question. I am following THIS tutorial on using the client-object model. And just starting from the top, I added the references, but using Microsoft.SharePoint.Client; keeps giving me the error that "the namespace 'SharePoint' does not exist in the namespace 'Microsoft', but I clearly see it on the right side panel. So looking at the instructions, the only difference I can think of is that fact that I am using Visual Studio Express and thus do not have the option to choose which framework to use when creating a new project. Other than that, I don't know what the problem might be. Does anyone have any ideas on what else I could be missing or how to correct this problem?
Make sure that the target framework is 3.5 and not 4 i.e for SP2010
Did you add the references to the Microsoft.SharePoint.Client assembly and Microsoft.SharePoint.Client.Runtime assembly as noted near the beginning of that tutorial?
Add required references to the solution.
Make sure that the target framework is 4 for SP2013(3.5 for SP2010).
Did you do this part of the tutorial you mentioned above?
To build the application, you must add references to two assemblies,
Microsoft.SharePoint.Client.dll and
Microsoft.SharePoint.Client.Runtime.dll. Installing SharePoint
Foundation installs these assemblies on the server. The two assemblies
are located in the following directory:
%ProgramFiles%\Common Files\Microsoft Shared\web server
extensions\14\ISAPI
Take a look at the references in your project and make sure you have the reference to the assembly. If it is not there try adding it, right click -->add reference and find "Microsoft.SharePoint.Client"
Thanks to those who mentioned the 4.0 framework.
Mine defaulted to .NET Framework 4 Client Profile (and I have no idea what that means), and the Namespaces looked good in Intellisense, but the build would say they weren't found! Crazy.
for anyone developing for SP2019, you need to target .net 4.5

Categories