I am trying to run an application in linux using mono, Application works fine but i cannot save the settings since the app.config uses userSettings of type="System.Configuration.UserSettingsGroup"
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="howto_save_restore_settings.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<howto_save_restore_settings.Properties.Settings>
<setting name="Left" serializeAs="String">
<value>100</value>
</setting>
<setting name="Top" serializeAs="String">
<value>100</value>
</setting>
<setting name="Width" serializeAs="String">
<value>300</value>
</setting>
<setting name="Height" serializeAs="String">
<value>300</value>
</setting>
<setting name="Contents" serializeAs="String">
<value />
</setting>
</howto_save_restore_settings.Properties.Settings>
</userSettings>
</configuration>
I have attached the app.config file for your reference
Can anyone suggest me or guide me so that the settings can be saved in Linux using mono
Related
I want to create a usable View class library, including views using Razor.
I have troubles to implement Razor Intellisense in my views.
I have already done a lot of research to find a solution, including this blog :
http://blogs.msdn.com/b/webdev/archive/2011/01/20/how-to-get-razor-intellisense-for-model-in-a-class-library-project.aspx and this related post: Razor in class library, missing intellisense, but nothing worked so far.
The last thing I tried was adding a web.config file in my View class library, but this did not enable Razor Intellisense.
web.config:
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.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=5.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>
<system.webServer>
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
</configuration>
Everything works when I am creating a MVC project instead of a Class Library to contain my Views... but I believe this would be a wrong thing to do.
I already have a MVC Project which contains only my Controllers, and a Class Library that contains my Models.
Does anyone have an idea about this issue ?
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.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=5.2.2.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.Optimization"/>
<add namespace="System.Web.Routing" />
<add namespace="System.Text.RegularExpressions"/>
</namespaces>
</pages>
</system.web.webPages.razor>
Everything builds, however it breaks intellisence on all .cshtml razor pages:
The name 'model' does not exist in the current context
However When I set the host factoryType version to 5.0.0.0 intellisence starts working.
Can anyone please Help
I have the following in my app.config file. I am using Slow Cheetah and just want to replace replace configuration/entityFramework/defaultConnectionFactory/parameters/parameter so it points to a diff server. ie value-data source=some-server....
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<appSettings>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="data source=.;Integrated Security=SSPI;Initial Catalog=SomeDb;MultipleActiveResultSets=true" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
</configuration>
I have tried to the following in the app.config.release but to no avail.
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="data source=dbserver;Integrated Security=SSPI;Initial Catalog=someDb;MultipleActiveResultSets=true"
xdt:Transform="Replace"
xdt:Locator="XPath(configuration/entityFramework/defaultConnectionFactory/parameters/parameter)" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
also tried xdt:Locator="Match(parameter)"
and xdt:Locator="XPath(parameter)
and many more but can't get it to work.
Ok. I feel a little silly but the solution is that I didn't need to specify a xdt:Locator.
If I just leave the App.Release.Config like this it will replace matching entry.
<parameter value="data source=dbserver;Integrated Security=SSPI;Initial Catalog=someDb;MultipleActiveResultSets=true"
xdt:Transform="Replace"/>
</parameters>
I am using SQL Azure as my logging repository using enterprise library 5.
I am running a full integration test from my own computer using all deployment connection strings and db connection strings of azure and try to write log to the DB.
This works fine !
But when acctually deploying in the staging enviorment and trying to write to the log , no exception is thrown but no log is written either.
Here is my app.config relevant sections :
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
<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>
<loggingConfiguration name="" tracingEnabled="true" defaultCategory="MainLogger"
revertImpersonation="false">
<listeners>
<add name="LoggingDb" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
databaseInstanceName="LoggingDb" writeLogStoredProcName="WriteLog"
addCategoryStoredProcName="AddCategory" traceOutputOptions="DateTime, Timestamp, ProcessId, ThreadId, Callstack" />
</listeners>
<formatters>
<add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
template="Timestamp: {timestamp}{newline}
Message: {message}{newline}
Category: {category}{newline}
Priority: {priority}{newline}
EventId: {eventid}{newline}
Severity: {severity}{newline}
Title:{title}{newline}
Machine: {localMachine}{newline}
App Domain: {localAppDomain}{newline}
ProcessId: {localProcessId}{newline}
Process Name: {localProcessName}{newline}
Thread Name: {threadName}{newline}
Win32 ThreadId:{win32ThreadId}{newline}
Extended Properties: {dictionary({key} - {value}{newline})}"
name="Text Formatter" />
</formatters>
<categorySources>
<add switchValue="All" name="MainLogger">
<listeners>
<add name="LoggingDb" />
</listeners>
</add>
</categorySources>
<specialSources>
<allEvents switchValue="All" name="All Events">
<listeners>
<add name="LoggingDb" />
</listeners>
</allEvents>
<notProcessed switchValue="All" name="Unprocessed Category">
<listeners>
<add name="LoggingDb" />
</listeners>
</notProcessed>
<errors switchValue="All" name="Logging Errors & Warnings">
<listeners>
<add name="LoggingDb" />
</listeners>
</errors>
</specialSources>
</loggingConfiguration>
<dataConfiguration defaultDatabase="LoggingDb" />
<connectionStrings>
<add name="LoggingDb" connectionString="Server=tcp:********.database.windows.net,1433;Database=****.Logging;User ID=*******#*******;Password=**********;Trusted_Connection=False;Encrypt=True;" providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
And I receive the following exception :
Invalid TraceListenerData type in configuration 'listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"'. (E:\sitesroot\0\web.config line 30)
While in Dev it works...
Any ideas or experience with that matter ?
Regards ,
James
Yes , as commented , following are the dlls that must be in your service directory in-order for the logging block to operate :
Microsoft.Practices.Unity.dll
Microsoft.Practices.ServiceLocation.dll
Microsoft.Practices.EnterpriseLibrary.Logging.Database.dll
Microsoft.Practices.EnterpriseLibrary.Logging.dll
Microsoft.Practices.EnterpriseLibrary.Common.dll
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.