app-config

IIS7, SSL and “The page was not displayed because the request entity is too large.”

会有一股神秘感。 提交于 2019-12-04 13:12:16
问题 We're running an ASP.NET application over SSL on IIS7 on a 64-bit machine. Now I've found several articles mentioning that to resolve this error, I need to modify the system.webServer/serverRuntime/uploadReadAheadSize . Fine. I tried via appcmd.exe and then just manually editing my web.config to set this: other config settings --> <serverRuntime uploadReadAheadSize="1048576" /> </system.webServer> However, when I set this in the site's web.config, I get this error: This configuration section

SQLite Entity Framework without App.config

落花浮王杯 提交于 2019-12-04 12:56:19
It is necessary to use the SQLite Entity Framework Database-first approach for the 3d-party application plugin. I searched all the Internet, including Add a DbProviderFactory without an App.Config , Problems using Entity Framework 6 and SQLite and many other. I have tried to use them all in different ways and combinations, but nothing helps: "An unhandled exception of type 'System.Data.Entity.Core.MetadataException' occurred in mscorlib.dll. Additional information: Schema specified is not valid. Errors: AutosuggestModel.ssdl (2,2): error 0152: No Entity Framework provider found for the ADO.NET

.NET DLL Settings and Config when there's a Web Reference - whats going on?

﹥>﹥吖頭↗ 提交于 2019-12-04 12:02:31
问题 My understanding is, that .NET doesn't really 'do' config files for DLLs - only the main Executable or Web App gets a config file, and all DLLs referenced by the Executable/Web App read from that. But in VS2008, if you add a Web Reference to a Class Library (DLL) project, it adds a Settings.Settings file and an app.config file to the project. They contain the main URL for the Web Reference. So what are these files for? There's no way for the DLL to read them unassisted, right? edit: the

How to write an URI string in App.Config

牧云@^-^@ 提交于 2019-12-04 10:11:49
问题 I am making a Windows Service . The Service has to donwload something every night, and therefor I want to place the URI in the App.Config in case I later need to change it. I want to write an URI in my App.Config. What makes it invalid and how should i approach this? <appSettings> <add key="fooUriString" value="https://foo.bar.baz/download/DownloadStream?id=5486cfb8c50c9f9a2c1bc43daf7ddeed&login=null&password=null"/> </appSettings> My errors: - Entity 'login' not defined - Expecting ';' -

How to catch exception when loading .NET WinForm app user.config file?

白昼怎懂夜的黑 提交于 2019-12-04 08:53:57
Sometimes in .NET (2.0) WinForm desktop apps which use the default configuration system, the user.config file will become corrupted and can't be loaded anymore (when the configuration system tries to load it, it'll throw a System.Xml.XmlException ). Putting aside the question of "why did the file get corrupted in the first place" (maybe it was cosmic rays, or HDD problems, or something else you can't control), the question then becomes "how can one catch this exception and do something meaningful with it? Microsoft's Connect site has a report on this sort of problem . Unfortunately, their

Alternative to XML Serialization for Configuration

久未见 提交于 2019-12-04 08:51:10
Currently, we use a giant configuration object that is serialized to/from XML. This has worked fine for the most part, but we are finding that in the case of power loss and application crashes, that the file could be left in a state that renders it unable to deserialize properly, effectively corrupting the configuration information. I would like to use the built-in app.config, but it doesn't seem to easily support custom classes. For example, with XML serialization, I can easily serialize a generic list<ComplexClass> with no extra code. It just works. It seems that when using app.config, you

How to access a connection string from within a library

心已入冬 提交于 2019-12-04 06:58:09
I have a web project (mvc) and data access layer in a separated class library project. I need to access to a connection string in app.config which sits in that library project. ConfigurationManager.ConnectionStrings[0].ConnectionString pulls something strange. I don't have this kind of settings neither in the library's config nor in the web project's config files. the App.config looks like that: <?xml version="1.0" encoding="utf-8" ?> <configuration> <connectionStrings> <add name="DALConnectionString" connectionString="User ID=sa;Password=pass;Initial Catalog=db;Data Source=srv\SQL2005;" /> <

Different configuration settings per developer for c# class library

做~自己de王妃 提交于 2019-12-04 06:24:55
We're a small team, working on a asp.net web project, as well as service, both projects dependent on a shared class library. We'd like to have the class library settings different per developer (and later on for production). In settings are included sensitive information, such as passwords, as well as hostnames. How should we assign these settings ? Unless I'm wrong, web.config/application settings aren't good enough, as they don't work for the shared class library. ps: Also, some variables should be statically linked, and the rest (such as connectionstrings) should be dynamic. The web.config

Change App.config during installation

我的未来我决定 提交于 2019-12-04 05:33:39
I have XML-file with settings like this <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > <section name="UpdateReportService.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </sectionGroup> </configSections> <applicationSettings> <UpdateReportService.Properties.Settings> <setting

Is there a way to set the local time, which may be different than the server's time, in an ASP.NET MVC3 application?

半腔热情 提交于 2019-12-04 05:19:58
问题 I have an MVC3 application the displays the current time locally, but displays the servers time when uploaded to hosting. Is there any way in the app.config or the web.config that I can set my local time to display once my app is uploaded to the server? UPDATE:I'm looking for a way to do this globally without going back and changing the code for every time I reference DateTime. It seems a little impractical to not be able to set the time for the application globally. 回答1: set timezone