Unrecognized configuration section system.identityModel - asp.net

I keep getting this error when building:
Unrecognized configuration section system.identityModel
I have added the following to my config:
<system.identityModel>
<identityConfiguration>
<audienceUris>
<add value="TEST"/>
</audienceUris>
<issuerNameRegistry type="System.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<trustedIssuers>
<add thumbprint="1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234" name="YourSTSName"/>
</trustedIssuers>
</issuerNameRegistry>
<certificateValidation certificateValidationMode="None"/>
</identityConfiguration>
</system.identityModel>
I am using .Net 4.6

You forgot this entry in configSections...
<configSections>
<!--WIF sections -->
<section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<section name="system.identityModel.services" type="System.IdentityModel.Services.Configuration.SystemIdentityModelServicesSection, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</configSections>

Related

Could not load file or assembly 'System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral,

I have this in my web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<sessionState mode="InProc" cookieless="false" timeout="20"/>
<httpRuntime maxRequestLength="8096" />
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
<add assembly="System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</assemblies>
<buildProviders>
<add extension=".edmx" type="System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider" />
</buildProviders>
</compilation>
</system.web>
It's work fine in my pc but in server host it gives me an error
in :
<add assembly="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
Parser Error Message: Could not load file or assembly 'System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.

Error 2 'WebDataGrid' is ambiguous in the namespace 'Infragistics.Web.UI.GridControls'

I have a regular aspx web page and one time I tried to debug it, it randomly gives me this issue:
Error 2 'WebDataGrid' is ambiguous in the namespace 'Infragistics.Web.UI.GridControls'.
this is part of my code
<%# Register Assembly="Infragistics45.Web.v13.1, Version=13.1.20131.2331, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
Namespace="Infragistics.Web.UI.GridControls" TagPrefix="ig" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<table>
<tr>
<td>
<ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="350px" Width="400px">
</ig:WebDataGrid>
</td>
</tr>
</table>
this is my web.config file
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<section name="infragistics.web" type="System.Configuration.SingleTagSectionHandler,System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<sectionGroup name="businessObjects">
<sectionGroup name="crystalReports">
<section name="rptBuildProvider" type="CrystalDecisions.Shared.RptBuildProviderHandler, CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, Custom=null"/>
</sectionGroup>
</sectionGroup>
</configSections>
<connectionStrings>
<add name="masterConnectionString" connectionString="Data Source=dmandelbaum_pc\SQLExpress;Initial Catalog=master;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<infragistics.web styleSetName="Default" styleSetPath="~/ig_res"/>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0">
<assemblies>
<add assembly="Infragistics4.Web.v13.1, Version=13.1.20131.2331, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB"/>
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="Infragistics4.WebUI.Documents.Reports.v13.1, Version=13.1.20131.2331, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB"/>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Infragistics4.WebUI.Documents.Excel.v13.1, Version=13.1.20131.2331, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB"/>
<add assembly="Infragistics4.WebUI.Documents.Word.v13.1, Version=13.1.20131.2331, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB"/>
<add assembly="Infragistics4.WebUI.Documents.IO.v13.1, Version=13.1.20131.2331, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB"/>
<add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="Infragistics45.Web.v13.1, Version=13.1.20131.2331, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB"/>
<add assembly="Infragistics45.WebUI.Documents.Reports.v13.1, Version=13.1.20131.2331, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB"/>
<add assembly="Infragistics45.WebUI.Documents.Excel.v13.1, Version=13.1.20131.2331, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB"/>
<add assembly="Infragistics45.WebUI.Documents.Word.v13.1, Version=13.1.20131.2331, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB"/>
<add assembly="Infragistics45.WebUI.Documents.IO.v13.1, Version=13.1.20131.2331, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB"/>
</assemblies>
<buildProviders>
<add extension=".rpt" type="CrystalDecisions.Web.Compilation.RptBuildProvider, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
</buildProviders>
</compilation>
</system.web>
<businessObjects>
<crystalReports>
<rptBuildProvider>
<add embedRptInResource="true"/>
</rptBuildProvider>
</crystalReports>
</businessObjects>
</configuration>
Any help would be greatly appreciated!
The error that you are getting indicates that there are two versions of the Infragistics.Web assembly loaded and since the type exists in both the compiler doesn't know which one to use.
If you look closely at the web.config you will see both references:
<add assembly="Infragistics4.Web.v13.1, Version=13.1.20131.2331, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB"/>
<add assembly="Infragistics45.Web.v13.1, Version=13.1.20131.2331, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB"/>
To resolve the specific error the Infragistics4.Web.v13.1 reference should be removed.
Note that there are also duplicate references in the web.config for other Infragistics assemblies that should also be removed. If these are not removed you may see similar errors for other classes.
Also it wouldn't matter if you remove the 4 or 45 versions of the assemblies and I suggested removing the 4 version because the Register tag in your page (or user control) references the 45 version.

Tridion Search is not working

During upgrade from Tridion 5.3 SP1 to Tridion 2011 SP1 we have configured search service as instructed in the Installation manual.
When we try to search ".aspx" word in the entire content it is giving error.
(80040356) The remote server returned an error: (404) Not Found.Unable to get the list of search results.Error occured while processing the request: Not Found.
System.Net.HttpWebRequest.GetResponse()
Tridion.ContentManager.Search.SolrClient.ProcessResponse(HttpWebRequest,Boolean,Boolean,String&)
Tridion.ContentManager.Search.SolrClient.Post(String,String,String&)
Tridion.ContentManager.Search.SolrClient.Query(String,Int32,Nullable`1,String&)
Tridion.ContentManager.Search.SearchQueryEngine.GetSearchResultsFromSolr(SearchQueryData,Int32,Nullable`1)
Tridion.ContentManager.Search.SearchQueryEngine.GetSearchResultsFromSolr(SearchQueryData,Int32,Nullable`1)
Tridion.ContentManager.Search.SearchQueryEngine.GetSearchResults(SearchQueryData,Int32,Int32)
Tridion.ContentManager.Search.ComWrapper.SearchQueryEngineFacade.GetSearchResults(Int32,Int32)
SearchBLST.GetListData
SearchBLST.GetSearchResults
SearchBLST.GetSearchResultsEx
Search.GetSearchResultsEx
How can we troubleshoot the issue?
<configuration>
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=349a39f202fa9b53"/>
<section name="tridionConfigSections" type="Tridion.Configuration.ConfigurationSections, Tridion.Common, Version=6.1.0.25, Culture=neutral, PublicKeyToken=349a39f202fa9b53"/>
<section name="tridion.common" type="Tridion.Configuration.CommonSettings, Tridion.Common, Version=6.1.0.25, Culture=neutral, PublicKeyToken=349a39f202fa9b53"/>
<section name="solrHost" type="Tridion.ContentManager.Search.SearchHost.Configuration.SolrHostConfiguration, TcmSearchHost, Version=6.1.0.996, Culture=neutral, PublicKeyToken=ddfc895746e5ee6b"/>
</configSections>
<configProtectedData>
<providers>
<add name="TridionRsaProtectedConfigurationProvider" keyContainerName="TridionRsaKeyContainer" useMachineContainer="true" description="Uses RsaCryptoServiceProvider to encrypt and decrypt" type="System.Configuration.RsaProtectedConfigurationProvider,
System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</configProtectedData>
<tridionConfigSections>
<sections>
<clear/>
<add/>
<add name="loggingConfiguration"/>
</sections>
</tridionConfigSections>
<tridion.common>
<tracing enabled="false">
<parameterValueTruncation default="50">
<parameterTypes>
<clear/>
<!-- Do not remove or change the settings for type System.Data.IDataRecord -->
<add type="System.Data.IDataRecord" assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" maxLength="0"/>
</parameterTypes>
</parameterValueTruncation>
</tracing>
</tridion.common>
<loggingConfiguration name="Logging Application Block" tracingEnabled="false" defaultCategory="General" logWarningsWhenNoCategoriesMatch="false">
<listeners>
<add name="Tridion Console Trace Listener" formatter="Trace Text Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.CustomTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=349a39f202fa9b53" traceOutputOptions="None" type="Tridion.Logging.TridionConsoleTraceListener, Tridion.Logging, Version=6.1.0.25, Culture=neutral, PublicKeyToken=ddfc895746e5ee6b" initializeData=""/>
<add name="Tridion Debug Trace Listener" formatter="Trace Text Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.CustomTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=349a39f202fa9b53" traceOutputOptions="None" type="Tridion.Logging.TridionDebugTraceListener, Tridion.Logging, Version=6.1.0.25, Culture=neutral, PublicKeyToken=ddfc895746e5ee6b" initializeData=""/>
<add name="Tridion Event Log" EventLog="Tridion" formatter="Event Text Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.CustomTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=349a39f202fa9b53" traceOutputOptions="None" type="Tridion.Logging.TridionEventLogTraceListener, Tridion.Logging, Version=6.1.0.25, Culture=neutral, PublicKeyToken=ddfc895746e5ee6b" initializeData=""/>
<add name="Log File" formatter="Trace Text Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=349a39f202fa9b53" traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=349a39f202fa9b53" fileName="D:\Tridion\log\TcmSearchHost.log"/>
<add name="Trace File" formatter="Trace Text Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=349a39f202fa9b53" traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=349a39f202fa9b53" fileName="D:\Tridion\log\TcmSearchHost.trace.log"/>
</listeners>
<formatters>
<add name="Log Text Formatter" template="{timestamp} <{win32ThreadId}> {message}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=349a39f202fa9b53"/>
<add name="Trace Text Formatter" template="{timestamp(HH:mm:ss.ffff)} <{win32ThreadId}> {message}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=349a39f202fa9b53"/>
<add name="Event Text Formatter" template="{message}
Component: {keyvalue(component)}
Errorcode: {keyvalue(errorcode)}
User: {keyvalue(username)}
{keyvalue(stacktrace)}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=349a39f202fa9b53"/>
</formatters>
<categorySources>
<add switchValue="All" name="Tridion.Logging.LoggingCategory.Tracing">
<listeners>
<add name="Trace File"/>
</listeners>
</add>
<add switchValue="All" name="Tridion.ContentManager.Search.SearchHost.LogCategory">
<listeners>
<!--add name="Tridion Console Trace Listener"/-->
</listeners>
</add>
<add switchValue="All" name="General"/>
</categorySources>
<specialSources>
<allEvents switchValue="Information" name="All Events">
<listeners>
<add name="Tridion Event Log"/>
</listeners>
</allEvents>
<notProcessed switchValue="All" name="Unprocessed Category"/>
<errors switchValue="All" name="Logging Errors & Warnings"/>
</specialSources>
</loggingConfiguration>
<!--To configure this Solr Instance as Master enable this solrHost xml node and disbale the other solrHost xml node-->
<!--<solrHost heartbeatTimeout="300" solrHome="%TRIDION_CM_HOME%\Libraries\solr-home" solrDataDir="%TRIDION_CM_HOME%\Search\solr-data" solrLogDir="%TRIDION_CM_HOME%\Log" jvmOptions="-Xmx768m -Xms768m -XX:MaxDirectMemorySize=1024m -Dfile.encoding=UTF-8 -Djava.security.auth.login.config=conf/jaaslogin.conf -Djava.security.auth.policy=conf/jaas.policy -Dlog4j.configuration=file:conf\log4j.properties -Djava.class.path=start.jar;lib\* -Duser.language=en -Duser.country=US -Denable.master=true" jvmFilePath="">-->
<!--To configure this Solr Instance as slave enable this solrHost xml node and disbale the other solrHost xml node. Set the -Dmaster.url, -Dmaster.authUser="MASTER_SOLR_INSTANCE_USER_NAME" and -Dmaster.authPassword-->
<!--<solrHost heartbeatTimeout="300" solrHome="%TRIDION_CM_HOME%\Libraries\solr-home" solrDataDir="%TRIDION_CM_HOME%\Search\solr-data" solrLogDir="%TRIDION_CM_HOME%\Log" jvmOptions="-Xmx768m -Xms768m -XX:MaxDirectMemorySize=1024m -Dfile.encoding=UTF-8 -Djava.security.auth.login.config=conf/jaaslogin.conf -Djava.security.auth.policy=conf/jaas.policy -Dlog4j.configuration=file:conf\log4j.properties -Djava.class.path=start.jar;lib\* -Duser.language=en -Duser.country=US -Denable.slave=true -Dmaster.url=MASTER_SOLR_INSTANCE_URL -Dmaster.authUser=MASTER_SOLR_INSTANCE_USER_NAME -Dmaster.authPassword=MASTER_SOLR_INSTANCE_PASSWORD" jvmFilePath="">-->
<solrHost heartbeatTimeout="300" jvmOptions="-Xmx768m -Xms768m -XX:MaxDirectMemorySize=1024m -Dfile.encoding=UTF-8 -Djava.security.auth.login.config=conf/jaaslogin.conf -Djava.security.auth.policy=conf/jaas.policy -Dlog4j.configuration=file:conf\log4j.properties -Djava.class.path=start.jar;lib\* -Duser.language=en -Duser.country=US" jvmFilePath="" solrHome="D:\Tridion\solr-home\" solrDataDir="D:\Tridion\solr-data\" solrLogDir="D:\Tridion\log\">
<jetty port="8983" stopControlKey="#SdlTridionJettySolrKey#" stopControlPort="8079" mainClassName="org/mortbay/start/Main" jettyConfigurationArguments="conf\jetty-jmx.xml conf\jetty.xml conf\jetty-logging.xml" home="D:\Tridion\solr-jetty\" tempDir="C:\Windows\TEMP\" logDirectory="D:\Tridion\log\"/>
</solrHost>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
<supportedRuntime version="v2.0.50727"/>
</startup>
<runtime>
<!--Enable Server GC mode for better performance in CLR 4.0. Note that this may lead to memory issues in CLR 2.0.-->
<gcServer enabled="true"/>
</runtime>
</configuration>
To troubleshoot the Search, first things I would try is to search with different search terms and see if they all return the same result (an error in your case).
Next is to check if the Tridion Content Manager Search Host service and the Tridion Content Manager Search Indexer service are running. If they are, see if restarting them makes any change to the situation.
When my Tridion Content Manager Search Host service is stopped, I get a different error, indicating the connection can't be established. So my thoughts would go out to a configuration error (the 404 mentioned in there makes me wonder if SOLR did install correctly). Check the settings in your MMC snap-in, and also check (like #robrtc mentioned) if you can run the reindex as described in the upgrade manual

Upgrading an ASP.NET MVC 3 Project to ASP.NET MVC 4

I have an asp.net MVC3 project I made an upgrade to asp.net mvc4 following this tutorial:
http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253806
I get the following error when I execute the project
[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast
to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A
originates from 'System.Web.WebPages.Razor, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context
'Default' at location
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'.
Type B originates from 'System.Web.WebPages.Razor, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context
'Default' at location
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'.
Step by step instructions can be found here:
http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253806
Specifically you're interested in binding redirects in your web.config.
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages"
publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/>
</dependentAssembly>
and don't forget to add the following to your <appSettings>
<add key="webpages:Version" value="2.0.0.0" />
Please change your webconfig in Views folder to below code if you upgrade to mvc4 from mvc3
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
</namespaces>
</pages>
</system.web.webPages.razor>
<pages
validateRequest="false"
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<controls>
<add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
</controls>
</pages>
</system.web>

MvcContrib namespace not visible in Views

I use MvcContrib Portable Areas, everything is ok, but I decided to use MvcContrib Grid. I have MvcContrib.dll and MvcContrib.FluentHtml.dll referenced to all projects of my solution.
The problem is that Views don't see MvcContrib even though it is is referenced.
#using MvcContrib result is: "The type or namespace MvcContrib could not be found". In the root (parent) project everything is ok.
I use .NET 4.0 and MVC 3.0
I reference my Web.config from portable areas Views folder.
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="MvcContrib"/>
<add namespace="MvcContrib.UI"/>
<add namespace="MvcContrib.UI.Html"/>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Globalization" />
<add namespace="Microsoft.Web.Mvc"/>
</namespaces>
</pages>
</system.web.webPages.razor>
<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>
<system.web>
<httpHandlers>
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
</configuration>
I had the same problem and I fixed it by adding the MVC Contrib reference to my root module and to the areas modules too!
Also you may need to add the following codes to your views web.config where ever you used this Third-Party component.
<system.web.webPages.razor>
<host factoryType="..." />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="MvcContrib"/>
<add namespace="MvcContrib.UI.Grid"/>
<add...
I hope this would help

Resources