I've added Simple Membership to my Asp WebForms application and when i run the application it tells me that
Could not load file or assembly 'System.Web.WebPages.Razor,
Version=3.0.0.0
why is that??
can i use Simple Membership with Asp WebForms?
Yes - can use simple membership with webforms, as described in:
http://blog.osbornm.com/2010/07/21/using-simplemembership-with-asp-net-webpages/
and http://www.mono-software.com/blog/post/Mono/226/Adding-ASP-NET-SimpleMembership-to-an-existing-MVC-4-application/
I am using in an Azure Cloud Service that ran fine locally, but ran into problems when publishing to the Cloud. This was resolved by removing references to WebMatrix.Data and WebMatrix.WebData (v2.0.0.0 manually added as per 2nd link above), then adding NuGet Package Microsoft.AspNet.WebHelpers to the project. This added references to v3 of WebMatrix with Copy Local = True. Downside is the NuGet package includes a load of other stuff that I don't actually need.
Hope that helps.
Related
How do I check in .net core (console app) if a given AD-group already exists ?
And how to create it, if not existing ?
If you're running your code on Windows as specified in the tags, quite easy. Install Windows Compatibility Pack nuget package and among others you'll get System.DirectoryServices.ActiveDirectory namespace with the classes that are available in classic .NET.
See this article for many code samples.
I have a simple .NET Core MVC solution based on a standard template which when started via the VS 2017 IDE does not seem to be rendering Bootstrap elements correctly. This happens whether I use IIS Express or Kestrel, and is browser-independent. But when I start it up from the prompt using dotnet run and browse to it manually it's fine. When I view the page source the correctly rendering version is (as per the environments defined in _Layout.cshtml) taking Bootstrap, JQuery et al from a CDN, whereas when run through the IDE it's using Bower\NPM packages under the web root.
I've tried rebuilding the dependencies to no avail. Static files are set. Any pointers as to what else to look at ?
You have to add app.UseStaticFiles(); line to your Startup class so your statics can be served by static files middleware
I just got started working on ASP.NET 5. I want to have a help page for my methods, I have seen few examples for creating help pages but most of them are MVC specific. I have gone through Microsoft.AspNet.WebApi.HelpPage package, it creates an Area for help page but I am not using MVC pattern.
Any suggestions how can I create help page other than this area approach?
I would suggest looking at Swagger and SwaggerUI. Swagger is an open standard, using JSON to document an API, used by the likes of PayPal and Microsoft (check out Logic apps in the azure portal).
There are some open source implementations for .Net (both of which I have used), which will self document your API, just by adding the NuGet packages to your project and a little bit of configuration:
https://github.com/domaindrivendev/Swashbuckle
https://github.com/domaindrivendev/Ahoy
Swashbuckle is the original project and Ahoy is the new version targeting ASPNET5. When downloading the package from NuGet you will still get Swashbuckle, just make sure you tick "include pre-release", and if you need any documentation look at the original GitHub project.
SwaggerUI (which is also included in Swashbuckle) adds an interface which you can use to navigate and test your API, by default this is available from "/swagger/ui" when your project is running.
Here is a sample repo in GitHub I put together showing how it can be used: https://github.com/mattridgway/ASPNET5-SwaggerUI
I am trying to combine Asp.Net Webforms and Asp.Net MVC together for hybrid application, as per our requirement. I am referring the hanselman's article for this. It is working fine while running from Visual Studio. But when I have deployed over IIS7, it is giving issue when I tried to visit page which is there, developed using MVC.
It is giving 500 internal server error. And when I try to debug the deployed site it is not even hitting the controller but directly giving error.
I am unable to found the issue and also unable to run page developed using MVC.
Please let me know if any further details needed.
Attaching image here.
I think I have found the issue. In deployment dll's are not copied perfectly. So, I updated Entity Framework, clear everything and redeploy it again. It works.
Thanks.
I have MVC3 installed on my dedicated server and I have an mvc3 website running there, the problem is:
In some pages I get this error:
"Could not load file or assembly 'System.Web.Helpers, Version=2.0.0.0"
And I don't know what is the problem because it didn't happen before in this website or any MVC3 website on the same server.
Note: The issue is happening in some pages I am using grid helper in, but there are some other pages has grid helper and working fine.
I tried this as well: http://haacked.com/archive/2008/11/03/bin-deploy-aspnetmvc.aspx while i know it is an old post, but with no hope as well.
You must have installed or updated some NuGet package in your project that depends on Razor WebPages v2 (System.Web.Helpers, Version=2.0.0.0) which is part of the upcoming ASP.NET MVC 4 release.
Take a look at all the referenced assemblies and inspect their dependencies.