I have changed from vs 2010 to 2012 with asp.net MVC4.I have connected my application to the database using Telerik open Access.
I am implementing syncfusion in my application.
I have two issues,
1.Getting Null Reference Exception(Object does not set to an instance of an object) at
#Html.Syncfusion().CaptchaControl("Captcha1").EnableRefreshImage(true).RequestMapper("RefreshCaptcha").
2.while connecting my apln to the database using telerik open access it is showing error that "ModelContext does not found"
Query 1: Getting Null Reference Exception(Object does not set to an instance of an object)
The reported issue occurred due to the unavailability of Syncfusion.Theme.Base dll in your application. Syncfusion has introduced a new assembly “Syncfusion.Theme.Base” in the latest version 10.3.0.43 for theming support. so refer the Syncfusion.Theme.Base dll in your application and add the Syncfusion.Theme.Base assembly in web.config to overcome this NullReference exception issue. Please refer the below code snippet,
[Web.Config]
<assemblies>
<add assembly="Syncfusion.Theme.Base, Version=10.304.0.43, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" />
</assemblies>
Query 2: while connecting my apln to the database using telerik open access it is showing error that "ModelContext does not found".
Before providing solution to this query, I would like to know more details on this issue. Could you please let us know the list of Syncfusion controls that you are using in your application, so that I can analyze the issue and provide you a better solution.
Related
I have a VS 2012 Web Project Up. I have ODP.NET installed as we are an Oracle Workshop. I inherited a project that uses Oracle.ManagedAccess.Data and EF.
Upon running the project in VS 2012, I get the following error:
There is a duplicate 'oracle.manageddataaccess.client' section defined..
The solution was to disable the following line in web.config
<!--<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />-->
Which was fine. The project compiled but upon executing a simple command such as getting a password back where it has to read the database another error was tripped up:
System.Data.ConstraintException: Column 'InvariantName' is constrained to be unique. Value 'Oracle.ManagedDataAccess.Client' is already present.
Now I'm aware that the error is tripped up by ODP.NET and having it exist in the GAC thus the double error reporting.
Is there another line I should be commenting out or is there a way to disable ODP.NET briefly? I don't want to install that client as I use it for other projects.
thanks
I found the following on the Oracle site regarding the "There is a duplicate 'oracle.manageddataaccess.client' section defined.":
If your application is a web application and the above entry was added
to a web.config and the same config
section handler for "oracle.manageddataaccess.client" also exists in
machine.config but the "Version" attribute values
are different, an error message of "There is a duplicate
'oracle.manageddataaccess.client' section defined." may be
observed at runtime. If so, the config section handler entry in the
machine.config for "oracle.manageddataaccess.client" has to be removed from the machine.config
for the web application to not encounter
this error. But given that there may be other applications on the machine
that depended on this entry in the
machine.config, this config section handler entry may need to be moved to all
of the application's .NET config file on
that machine that depend on it.
I hope it helps.
I was getting the same error for an ASP.Net MVC project. I found that there is a version mismatch for oracle.manageddataaccess.client in the Web.config of the project, and machine.config in
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config, and
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config.
I had Version=4.122.18.3 in the Web.config and Version=4.122.1.0 in the machine.config.
I updated the version(replaced Version=4.122.1.0 of oracle.manageddataaccess.client with 4.122.18.3) in both the machine.config, and the problem resolved.
In my case I have multiple projects. One a Entity Framework data model, another which is an WCF Service using the EF Model, a WPF project using the WCF Service, and finally, my ASP.NET MVC prject, using the Entity Framework Data model directly.
We use Oracle and had a Nuget package oracle.manageddata. I used Version 12.1.21 in all the others, except my ASP project (which had version 12.1.22). After downgrading to what the other projects are using, my Web ASP is running again. Using different Nuget versions in various projects, in the same solution, doesn't seem to be such a good idea.
There are multiple ways to solve this problem. Not everyone has the luxury or desire to modify the machine.config (especially on a server). Perhaps the easiest way to solve this problem is to use bindingRedirect in your web.config (or app.config, if not a web application).
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.122.21.1" newVersion="4.122.21.1"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
NOTE: The version I am using is 4.122.21.1. Be sure you match your own version that you are using.
NOTE: The redirect is on Oracle.ManagedDataAccess, not Oracle.ManagedDataAccess.Client; this is a common mistake that developers make.
If you want to make the change in the machine.config, proceed carefully as this could have unanticipated consequences on other apps on the machine. The simplest modification is to change the version of the Oracle.ManagedDataAccess.Client section from a strong version to any version by using an asterisk "*".
<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=*, Culture=neutral, PublicKeyToken=89b483f429c47342" />
If you need additional clarification, let me know and I can give more details.
I am trying to follow this tutorial to access more user information when they log in using Facebook.
Get more information from Social providers used in the VS 2013 project templates
Ultimately I would like to be able to get data such as the user's firstName, lastName, Zip, etc. when a user logs in using Facebook and store that in the AspNetUsers table when they register. I will try this link.
For now I would just like to get this tutorial working but it is slightly different from my MVC 5.2.2 project. I am getting a 'type or namespace name "FB" could not be found. How can I fix this error?
Also, the ExternalLoginCallback is different, would I add the "await StoreFacebookAuthToken(user);" above var result = await SignInManager.ExternalSignInAsync(loginInfo, isPersistent: false);?
Solved:
I opened the Package Manager Console and it displayed a message which said that I was missing assemblies and it gave me the option to Restore the assemblies.
Than I received an error, "Could not load file or assembly 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified."
So I went to Manage NuGet Packages for Solution... and I just updated everything then it worked.
Been on this for hours...
New Windows 2012 server, fresh IIS 8 installation with all asp.net, 3.5, 4.5, ISAPI extensions/filters/whatever all installed.
Application pool is 4.0 and integrated mode. This is only website using that app pool.
Try and run website with index.vbhtml as default document (after adding it to default documents) and I get "cannot server this sort of page" "explicitly forbidden".
I look at "handler mappings" in IIS manager. .vbhtml is set to "forbiddenhandler" so I changed it to "System.Web.DefaultHttpHandler, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Now I just get "The DefaultHttpHandler.BeginProcessRequest method is not supported by IIS integrated pipeline mode"
I'm now stuck! What's the problem with this darned server please?
IIS shouldn't directly serve those files, they are rederred through the MVC pipeline through a controller. If you have a file say, /Views/Home/Index.cshtml, you should be navigating to http://siteurl/home/index to see the content from that page via the Index action on your Home controller.
NOTE: Based on comment thread below, OP's underlying issue appears to have been with the installation (or lack of) ASP.NET MVC (or a corrupted installation, as he states in the comments that he did have it installed)
I have installed .NET Framework 3.5 SP1 and ASP.NET MVC CTP in a Windows Server 2003 R2 box, but my ASP.NET MVC site still doesn't work on that server. I was searching the internet and IIS for a solution and I noted that I can't choose other .NET Framework version besides 2.0 for my virtual directories. I'm almost sure if I correct this I can make my site work there.
Currently the main "/" URL answers with:
Directory Listing Denied
This Virtual Directory does not allow contents to be listed.
And the "/Default.aspx" URL answers with:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Section or group name 'system.web.extensions' is already defined.
Phil Haack has a pretty good writeup here
http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
I had the similar issue.
I recently upgraded my server to support .net framework 4.0.
Converted my application to support .net fx 4.0.
Deployed the application on sever and trying to test .. I get "HTTP Error 404 - File or directory not found"
Solution
Open IIS Manager, expand the master server node (i.e, the Servername node), and then select the Web service extensions node.
In the right pane of IIS Manager, right-click the extension "ASP.NET v4.0.*".
Click the Allow button.
Besides Jason's answer, the common things to look for is:
Enable Wildcard mapping and point it to the aspnet assembly Phil mentions in Jason's link.
The /default.aspx error you are getting seems to be a web.config configuration error. At the very top of your web.config, look for:
<sectionGroup name="system.web.extensions"
Most likely it is defined twice. You only need the reference for the RC build you have. If you need the exact RC references, create a new ASP.NET MVC Web Project in a temp folder. And then grab the web.config from it.
-E
I also encountered this problem, in my case the solution was to uninstall the ASP.NET MVC Beta.
The application I was trying to get working had the version 1 MVC dlls bin deployed and once the Beta was uninstalled it all worked fine.
Similar issue: We tried to install an MVC4/.NET 4 app on an IIS6 box, set up everything as described, and got same error:
Directory Listing Denied
This Virtual Directory does not allow contents to be listed.
For us, the final fix was to add the UrlRoutingModule to the web.config:
<add name="UrlRoutingModule"
type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Which makes sense, but I don't know why we needed to explicitly add it and others didn't. (We are running in a directory under Sharepoint, maybe related...)
I have a ASP.NET MVC app that is using SQLite database through Entity Framework.
Everything works on VS 2008's local development webserver.
However, deploying the web app to my service provider causes this error:
[ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.]
System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +1308959
System.Data.EntityClient.EntityConnection.GetFactory(String providerString) +35
Service provider has commented that they do not support SQLite. I had though that SQLite is independent of service provider's settings since it's App_Data deployable.
Has anyone experiences of a succesfull Entity Framework + SQLite deployment?
Cheers,
-pom-
You're unlikely to be reading this anymore, but you're missing the following in your app.config (or, for you, web.config):
<configuration>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite" />
<add name="SQLite Data Provider" invariant="System.Data.SQLite"
description=".Net Framework Data Provider for SQLite"
type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
</DbProviderFactories>
</system.data>
</configuration>
Specifically, if you're using sqlite in a library which is linked into your website, you must add this to the config file of the website - not the library! This is because of how you're loading the provider: essentially, you're determining at runtime which dll to load, using the string "System.Data.SQLite", and locating the appropriate provider is done using the settings of the entry assembly.
Edit: By the way, when you're writing the library that has an sqlite dependancy, you can avoid this complexity. You do not need to use DbProviderFactories to look for sqlite at runtime; you can take a compile-time dependancy just as well, which can be easier to manage. Then you can ignore the above app.config section, and instead replace all instances of:
DbProviderFactories.GetFactory("System.Data.SQLite").CreateConnection()
with
System.Data.SQLite.SQLiteFactory.Instance.CreateConnection()
If you do so, you're using a plain library call to create the connection and there's no runtime selection of db provider. That can be less flexible since you can no longer exchange data providers via the config file, but for many libraries that's sufficient. Unfortunately, if you don't control the library code, this isn't an option.
Have you tried adding the required DLL(s) to your application's bin directory? You might want to look at Phil Haack's article on Bin Deploying ASP.NET MVC for ideas on how to do this automatically.
SQLite needs full trust permission for ASP.NET application deployment. Many shared hosting providers don't allow that. You might wan't to check this.