Configuration Error / Web.config
Hej der,Jeg har problemer med at benytte min egne configuration settings i min web.config.
Jeg forsøger at benytte eksemplet med overskriften:
'Creating New Configuration Sections' fra .Net dokumentationen.
men jeg får en fejlmeddelselse:
Parser Error Message: File or assembly name System, or one of its dependencies, was not found.
Source Error:
Line 3: <configSections>
Line 4: <sectionGroup name="dataBase">
Line 5: <section name="infoSearch" type="System.Configuration.NameValueSectionHandler, System" />
Line 6: </sectionGroup>
Line 7: </configSections>
Source File: c:\inetpub\wwwroot\InfoSearch_ver_145\web.config Line: 5
Assembly Load Trace: The following information can be helpful to determine why the assembly 'System' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = System
(Partial)
LOG: Appbase = file:///c:/inetpub/wwwroot/InfoSearch_ver_145
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Post-policy reference: System
LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.0.3705/Temporary ASP.NET Files/infosearch_ver_145/7fdfac71/f6605887/System.DLL.
LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.0.3705/Temporary ASP.NET Files/infosearch_ver_145/7fdfac71/f6605887/System/System.DLL.
LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/InfoSearch_ver_145/bin/System.DLL.
LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/InfoSearch_ver_145/bin/System/System.DLL.
...osv
***************************************
Jeg har prøvet at tilføje 'C:/WINNT/Microsoft.NET/Framework/v1.0.3705/Temporary ASP.NET Files/' som ny mappe i indekstjenester/system via configurationmanager'en, men det løser ikke mit problem..
Nogen idéer?
I får også lige den kode jeg bruger (C#):
Web.config:
***************************
<configuration>
<configSections>
<sectionGroup name="dataBase">
<section name="infoSearch" type="System.Configuration.NameValueSectionHandler, System" />
</sectionGroup>
</configSections>
<dataBase>
<infoSearch>
<add key="name" value="infoSearch" />
<add key="server" value="SUSSI" />
<add key="database" value="isControl" />
<add key="login" value="sa" />
<add key="password" value="" />
</infoSearch>
</dataBase>
*************************
codebehind:
*************************
System.Collections.Specialized.NameValueCollection configTest = (System.Collections.Specialized.NameValueCollection) ConfigurationSettings.GetConfig("dataBase/infoSearch");
testTextBox.Text = configTest["database"];
**************************
Fejlen kommer når jeg initialiserer configTest
