SubSonic - Generated Classes have the following error - the type or namespace name does not exist in KimDal - subsonic

Im trying to generate my dal and this works but when i check my code in visual studio 2008 i get this message "the type or namespace name does not exist in KimDal"
Im using sql expreess 2005, full version of vs2008, and i setup a new c# 2.0 website.
I installed the 2.1 installer for subsonic, add added it to my external tools, i added a refernce to the dll which added it and other dlls to my bin folder.
I also addeded references to system.web and system.configuration as i saw somehwere that this resolved someone elses issue.
My config is below, is the error im geting normal within intelisense when i look at the class, or do i need to fix something and how do i fix it.
<configuration>
<configSections>
<section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" requirePermission="false"/>
</configSections>
<appSettings/>
<connectionStrings>
<!-- Development connection string -->
<add name="kimWebApp" connectionString="Data Source=7NQ384J\SQLExpress;Initial Catalog=kim2;Integrated Security=True"/>
</connectionStrings>
<SubSonicService defaultProvider="kimWebAppProvider">
<providers>
<clear/>
<add name="kimWebAppProvider" type="SubSonic.SqlDataProvider, SubSonic" connectionStringName="kimWebApp" generatedNamespace="KimDal"/>
</providers>
</SubSonicService>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="false" defaultLanguage="c#">
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
<system.codedom>
</system.codedom>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.webServer>
</system.webServer>
</configuration>

Dont worry i now have this working, and was able to generate the code, to do so, i basically had to do the following.
Create a webconfig that looks like this
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<configSections>
<section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" allowDefinition="MachineToApplication" restartOnExternalChanges="true" requirePermission="false"/>
</configSections>
<appSettings/>
<connectionStrings>
<add name="kimconnection" connectionString="Data Source=7NQ384J\SQLExpress;Initial Catalog=kim2;Integrated Security=True;"/>
</connectionStrings>
<SubSonicService defaultProvider="kimAppProvider">
<providers>
<clear/>
<add name="kimAppProvider" type="SubSonic.SqlDataProvider, SubSonic" connectionStringName="kimconnection" generatedNamespace="kimdata"/>
</providers>
</SubSonicService>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true" defaultLanguage="C#">
<buildProviders>
<add extension=".abp" type="SubSonic.BuildProvider, SubSonic"/>
</buildProviders>
<assemblies>
<add assembly="System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
<add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<pages>
<controls>
<add assembly="SubSonic" namespace="SubSonic" tagPrefix="subsonic"/>
</controls>
</pages>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>
I copied the config file from my installation of subsonic C:\Program Files\SubSonic\SubSonic 2.1 Final\src\SubSonicCentral
Changed for my needs, i then added the reference to subsonic which included all the dlls below.
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.Data.dll
Microsoft.Practices.ObjectBuilder.dll
MySql.Data.dll
System.Data.SQLite.dll
subsonic.dll

Related

Data Access Application Block Configaration settings

I am using DAAB 5.0 in my WCF application, I need to add the following code in my Web.Config for DAAB to work
<configuration>
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" />
</configSections>
<dataConfiguration defaultDatabase="defaultConnString" />
<connectionStrings>
<add name="defaultConnString" connectionString="..."
providerName="System.Data.SqlClient" />
</connectionStrings>
However in higher environament Web.Config is quto generated, So I am manually pasting the config section in the Web.Config
Is there any alternative to have config section in a differrent file?

Enable Azure Website Application Diagnostics

I have a Windows Azure Website (built with ASP.NET Web Pages), and in the configuration have enabled "Application Diagnostics" for both Blob storage and file storage:
I've then added some Trace statements to a Razor page to test it out
#{
System.Diagnostics.Trace.TraceInformation("INFORMATION");
System.Diagnostics.Trace.TraceWarning("WARNING");
System.Diagnostics.Trace.TraceError("ERROR");
}
However, this results in no logs at all, either in the file system or the blob.
For good measure I attempted to add various settings to my web.config file (shown below), although from the documentation I read, it doesn't seem as though this should be necessary. But it makes no difference - I still see no diagnostic logs in the file system or the blob.
<system.web>
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
<trace enabled="true"/>
<httpRuntime targetFramework="4.5" />
</system.web>
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="AzureDiagnostics">
</add>
<add name="WebPageTraceListener"
type="System.Web.WebPageTraceListener, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</listeners>
</trace>
</system.diagnostics>
Is there anything else I need to configure that I've missed? Could it be that this simply doesn't work at all for ASP.NET Web Pages projects?
To enable tracing from a razor page add the following to your web.config:
<system.codedom>
<compilers>
<compiler
language="c#;cs;csharp"
extension=".cs"
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
compilerOptions="/define:TRACE"
warningLevel="1" />
</compilers>
</system.codedom>
Source: http://blogs.msdn.com/b/webdev/archive/2013/07/16/tracing-in-asp-net-mvc-razor-views.aspx
Note that tracing from your cs files should work without any changes to web.config.

403 forbidden all *.axd files - aragh

I can run the application on my development machine.
When I go to publish it to my production machine, it does not work. Says that the .axd files are forbidden.
Any ideas? I'm getting so frustrated!
Edit:
As a test, I've changed to be "storage=file;". When I send a request to the server for generating a chart, the chart actually appears in my folder - it just doesn't get sent back to the browser in the request.
ARAGH! What is going on!?!?!
Added web.config
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="ChartImageHandler" value="storage=memory;"/>
</appSettings>
<connectionStrings>
<add name="VS265178_1ConnectionString" connectionString="Data Source="HIDDEN"/>
</connectionStrings>
<system.web>
<httpHandlers>
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
validate="false" />
</httpHandlers>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<authentication mode="Forms">
<forms loginUrl="Login.aspx" name=".CFCASPXFORMSAUTH" defaultUrl="Default.aspx"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
<machineKey validationKey="HIDDEN" decryptionKey="HIDDEN" validation="SHA1"/>
<!-- Custom Membership Provider Configuration -->
<membership defaultProvider="CFMembershipProvider" userIsOnlineTimeWindow="15">
<providers>
<clear/>
<add name="CFMembershipProvider" passwordFormat="Clear" type="HIDDEN" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" writeExceptionsToEventLog="false"/>
</providers>
</membership>
<profile defaultProvider="CFProfileProvider">
<providers>
<add name="CFProfileProvider" type="HIDDEN"/>
</providers>
</profile>
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<remove name="ChartImageHandler"/>
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</handlers>
</system.webServer>
</configuration>
URL rewrites on the web site are inherited by all child applications. One solution is to add this to your application web.config:
<system.webServer>
<rewrite>
<rules>
<!-- remove parent rewrite rules -->
<clear/>
</rules>
</rewrite>
</system.webServer>
So the answer.
URL Rewrites are a killer.
I had a wordpress installation on a web application which was above the application I was having problems with. The wordpress installation was actually doing rewrites and because it wasn't a file or directory (wordpress default) it was rewriting any request that didn't have a physical corresponding file or folder.
If you're getting random errors, and you're using sub applications - look at the REWRITES!

Report Viewer Configuration Error

I want to display report inside of SharePoint. My ASPX page contains one Microsoft.ReportViewer.WebForms.ReportViewer control. When I try to open this page, I get error:
Report Viewer Configuration Error
The Report Viewer Web Control HTTP Handler has not been registered in the application's web.config file. Add <add verb="&ast;" path="Reserved.ReportViewerWebControl.axd"
type = "Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> to the system.web/httpHandlers section of the web.config file, or add <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> to the system.webServer/handlers section for Internet Information Services 7 or later.
The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible version.
Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. The request failed with the error message: -- 401 UNAUTHORIZED<RSError xmlns="http://www.microsoft.com/sql/reportingservices"><MoreInformation><Message>Unbekannter Fehler beim Reporting Services-Endpunkt für diese SharePoint-Website. Wenden Sie sich an den Administrator der SharePoint-Website.</Message></MoreInformation></RSError> --.
Do I indeed need to add this section to web.config? And where should I add this?
Try to add the following sections,
<add verb="*" path="Reserved.ReportViewerWebControl.axd" type = "Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
to system.web in section handlers
and add the following sections
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
to system.webserver in section handlers
Actually the error message explains everything! Hope it helps.
This the complete web.config after I solve this issue:
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
</httpHandlers>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<defaultDocument>
<files>
<add value="PreviewReport.aspx" />
</files>
</defaultDocument>
<handlers>
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
</handlers>
</system.webServer>
</configuration>
thanks .
I use godaddy with a shared host and this solution work for my aplication thanks a lot.
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>
</system.webServer>

Devexpress aspx controls not styling after publish to different server

I have a few Devexpress aspx controls on a website that look fine on our development server. When I publish the exact same files to the live server, everything works, but none of the controls have any styling.
I have checked the site, in the IE dev tools, and it seems to have a link to only 1 DXR.axd while the dev server has a link to 3. Each one is different.
Don't really know where to begin checking as everything seems identical on both servers, including web.config, see below:
<?xml version="1.0"?><configuration>
<configSections>
<sectionGroup name="devExpress">
<section name="settings" type="DevExpress.Web.ASPxClasses.SettingsConfigurationSection, DevExpress.Web.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false"/>
<section name="compression" type="DevExpress.Web.ASPxClasses.CompressionConfigurationSection, DevExpress.Web.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false"/>
<section name="themes" type="DevExpress.Web.ASPxClasses.ThemesConfigurationSection, DevExpress.Web.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false"/>
<section name="errors" type="DevExpress.Web.ASPxClasses.ErrorsConfigurationSection, DevExpress.Web.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false"/>
</sectionGroup>
</configSections>
<appSettings/>
<connectionStrings>
<add name="testConnectionString" connectionString="Server=<test>;User ID=root;Password=password;Database=test" providerName="MySql.Data.MySqlClient"/>
</connectionStrings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="DevExpress.Web.ASPxScheduler.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
<add assembly="DevExpress.Web.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
<add assembly="DevExpress.XtraScheduler.v10.2.Core, Version=10.2.8.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
<add assembly="DevExpress.Data.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
<add assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="DevExpress.Web.ASPxPivotGrid.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
<add assembly="DevExpress.PivotGrid.v10.2.Core, Version=10.2.8.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/></assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<httpModules>
<add type="DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" name="ASPxHttpHandlerModule"/>
</httpModules>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add type="DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" name="ASPxHttpHandlerModule"/>
</modules>
</system.webServer>
<devExpress>
<settings rightToLeft="false"/>
<compression enableHtmlCompression="false" enableCallbackCompression="true" enableResourceCompression="true" enableResourceMerging="false"/>
<themes enableThemesAssembly="true"/>
<errors callbackErrorRedirectUrl=""/>
</devExpress>
</configuration>
Deploy the "ASPxThemes" assembly (DevExpress.Web.ASPxThemes.vXX.Y.dll) within the server GAC or WebSite Bin folder.
This assembly stores required DevExpress ASP.NET Themes resources.

Resources