Coordination WebMatrix.Data and WebMatrix.WebData work with Oracle DB - asp.net-mvc

i have a MVC 5 project with an oracle DB,
i need to use sum sort of membership provider, as i understand it,
at the moment there's no boilerplate provider which works with OracleDB for mvc.
can anybody recommend a solution?
I'm trying to adjust microsoft "WebMatrix.Data" and "WebMatrix.WebData" to work with oracle ,i have the source code from http://aspnetwebstack.codeplex.com/SourceControl/network,
has anyone tried this before? and if so perhaps can help with helpf links or the code?

as it happens i solved it by downloading the source code for WebMatrix from Microsoft git and rewriting the entire project to work with Oracle DB

Related

asp.net mvc database first .cs files not generated

I have an existing Access database and need to build a REST api. The best way I thought is to migrate it to SQL server and build an asp.net mvc web api. But I'm a complete noob in EF... I tried database first following this. But EF didn't seem to generate any .cs classes..or .tt files.
The only file I got is .designer.cs.
Any help is greatly appreciated..

How can I access an ASP.NET MVC application through IIS Express while using OpenCover?

I am using OpenCover to cover a very simple ASP.NET MVC application. It's basically just a shell application: a handful of controller methods and not much else.
I am attempting to user OpenCover to launch an instance of IIS 8.0 Express, through which I will run the MVC application. However, when I try to browse to the site, I get an "Access is denied" 401.2 error. I have tried numerous things to solve this, mostly revolving around different ways to enable Windows Authentication. Most of my attempts have been based on advice from questions like this. Despite my efforts, I'm still getting this 401.2 error. Also, I should point out that when running this application through VS2013, I can access the site just fine.
One final detail is that in order to use OpenCover, I cannot use the full version of IIS because OpenCover and IIS don't work well together, so IIS Express is a must. If there is any sort of configuration details I can provide you with in order for you to better help me, please let me know. Thank you!

Entity Framework 6.0 Code First Migrations to Azure SQL DB not working.

I am trying to create an ASP.NET MVC site loosely based on this tutorial.
http://www.windowsazure.com/en-us/develop/net/tutorials/web-site-with-sql-database/
I am using VS2013 preview which gave me the option to create an ASP.NET MVC 5 site. Also, using the following packages:
EntityFramework 6.0.0-rc1
Microsoft.AspNet.Identity.Core" 1.0.0-alpha1
Microsoft.AspNet.Identity.EntityFramework 1.0.0-alpha1
After configuring a website and associating it with a database in Azure, I proceeded to run the following commands in the package manager console:
enable-migrations -ContextTypeName IdentityDbContext
add-migration Initial
When I published to Azure with the database specified and the "Execute Code First Migrations" checkbox checked, the site deployed properly, but after inspecting my DB, the migrations didn't run. My migrations had been successful previously on a site with ASP.Net MVC 4 and EF 5.0.
I would guess the problem is that EF 6 is ignoring the connection string that is set during publishing, but I cannot understand why.
Any help would be appreciated. Thank you.
This guide looks comprehensive: http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/migrations-and-deployment-with-the-entity-framework-in-an-asp-net-mvc-application
The key part being "Execute Code First Migrations (runs on application start)"
I hope that helps.
When I faced this, I needed to change the connection string to point to the Azure DB instead of the local SQLLite DB.

Deploying EF 4.1 code-first ASP.NET MVC3 to medium trust shared hosting

I think, this is quite common situation nowadays, so its surprising, that I have troubles finding nice and clean solution for it (even here at SO).
I have my ASP.NET MVC3 web application using Entity Framework 4.1 with code-first approach (using DatabaseInitializer to seed default data). I also tried two database options: SQL Express 2008 R2 and SQL Compact 4. Everything is working fine on local.
Now I want to host my app so I found hosting (middle one called 'optimal') and finally (after some issues) got into state, where I am getting medium-trust error (I believe).
The application attempted to perform
an operation not allowed by the
security policy. To grant this
application the required permission
please contact your system
administrator or change the
application's trust level in the
configuration file.
Let's take as fact that I can't configure that hosting any way and I do not think, that they are going to switch me to full-trust.
What do I have to do, to make my application work on medium-trust hosting?
Edit: I have found some answers that are usually propagating setting medium trust at local dev and just do it like that, so my question could now be something like:
What are "top 5 reasons" why your ASP.NET MVC3 EF 4.1 app won't work at medium-trust?
Edit: I have added bounty to this becuase I would like to see some discussion.. or at least more oppinions/experiences, containing more than just "set medium trust at local dev". Maybe there is nothing to discuss here, but I am just curious because I already spent more time on this than I would like.
I've seen other people complain of the same error when the server did not have .NET 3.5 Service Pack 1 and were able to work around it by putting the DLLs in their bin folder.
There's also a little more info here about a few things to check:
log4net throwing Security Exception in ASP.Net MVC web application
Do you have the latest EF Code First library? Everything before the RC was not medium trust compatible.
If you are going to use SQL CE 4, it is medium trust compatible but did you deploy the SQL CE database engine files?
Are you sure your problem is EF Code First? AKA - Have you tried just deploying a simple MVC site first and getting it running? Here's an article on setting up MVC in medium trust and another on bin deploying MVC3 for hosts who aren't running/supporting MVC3 yet.

ASP.NET Membership/Role providers for Postgres?

I am creating an MVC site and would like to use the built in Membership and Roles for .Net.
I'm using the the .Net Data Provider for Postgresql (Npgsql), but am having trouble defining the membership defaultProvider and Postgresql connection string to connect to my local database.
Can anyone help?
I have not verified this, but will be using it in a project soon. Hopefully I will have more info to follow, and it will "just work" :)
http://code.google.com/p/pgsqlprovider/
Hoping to use this software stack
Windows Server 2008
PostgreSQL
PostGIS
Castle ActiveRecord
NHibernate
NHibernate.Spatial
ASP.NET MVC 3 with Membership/Role providers
[FOLLOW UP]
I ran the NuGet command "Install-Package Nauck.PostgresSQLProvider" to install the PostgreSQL ASP.NET Membership Provider created by Daniel Nauck and Jason Sznol.
http://nuget.org/List/Packages/Nauck.PostgresSQLProvider
Project Home
http://dev.nauck-it.de/projects/aspsqlprovider
You'll need to run this SQL to create the membership tables:
http://dev.nauck-it.de/projects/aspsqlprovider/repository/revisions/master/changes/src/NauckIT.PostgreSQLProvider/DatabaseSchema.sql
Finally the web.config file will need to be updated... I used this example for direction:
http://dev.nauck-it.de/projects/aspsqlprovider/repository/revisions/master/entry/src/Example/Web.config
So far authentication works, as does hashed passwords, all thats left to test is authorization.
I was a little frustrated with the nauck version, so I wrote my own. You can try it out here it you'd like. It has unit tests and a bit of documentation.

Resources