Could not load file or assembly ‘WebMatrix.Data`
Go into: Tools > NuGet Package Manager > Package Manager Console And run the following command: PM> Install-Package Microsoft.AspNet.WebPages.Data
Go into: Tools > NuGet Package Manager > Package Manager Console And run the following command: PM> Install-Package Microsoft.AspNet.WebPages.Data
Have a look at connectionstrings.com for every possible variation – a very handy resource I use all the time Specifically, you want this format: Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI; This, of course, only works if the domain account in question is the one opening the connection. There’s no easy way to connect with arbitrary credentials – … Read more
Try putting the following in your nlog tag: <nlog throwExceptions=”true” internalLogFile=”c:\nlog.txt” internalLogLevel=”Debug” /> That might help determine what the problem is
As the other answers say, you need to provide an XML Schema document for your custom configuration section. There’s no need to add the .xsd schema file to some global directory; you can reference it directly from your custom section in the App.config file: <configuration> <!– make the custom section known to .NET’s configuration manager … Read more
This solution works on IIS 10+ version and allows to remove x-powered-by and server headers in server response. In IIS 10 a new attribute was added: removeServerHeader. We need to create web.config file in asp.net core application with following content: <?xml version=”1.0″ encoding=”utf-8″?> <configuration> <system.webServer> <security> <requestFiltering removeServerHeader=”true” /> </security> <httpProtocol> <customHeaders> <remove name=”X-Powered-By” /> … Read more
I needed to have different smtp configurations in the web.config depending on the environment: dev, staging and production. Here’s what I ended up using: In web.config: <configuration> <configSections> <sectionGroup name=”mailSettings”> <section name=”smtp_1″ type=”System.Net.Configuration.SmtpSection”/> <section name=”smtp_2″ type=”System.Net.Configuration.SmtpSection”/> <section name=”smtp_3″ type=”System.Net.Configuration.SmtpSection”/> </sectionGroup> </configSections> <mailSettings> <smtp_1 deliveryMethod=”Network” from=”mail1@temp.uri”> <network host=”…” defaultCredentials=”false”/> </smtp_1> <smtp_2 deliveryMethod=”Network” from=”mail2@temp.uri”> <network host=”1…” defaultCredentials=”false”/> … Read more
These settings are used for dynamic compilation. They can be safely removed from the web.config if you do pre-compilation and only put the compiled assemblies on the webserver. See also The impact of multiple compiler definitions in system.codedom in web.config
This is an example of web.config file inheritance. From MSDN You can distribute ASP.NET configuration files throughout your application directories to configure ASP.NET applications in an inheritance hierarchy. This structure allows you to achieve the level of configuration detail that your applications require at the appropriate directory levels without affecting configuration settings at higher directory … Read more
in web.config: <appSettings> <add key=”message” value=”Hello, World!” /> </appSettings> in cs: string str = ConfigurationManager.AppSettings[“message”].ToString();
Unfortunately, there are a number of situations that can cause this problem. The most likely problem though is that the schema for the document has been set incorrectly. This can happen when you install a newer version of .NET and/or Visual Studio on the computer. The fix is simple though. From the Visual Studio documentation: … Read more