Showing posts with label config. Show all posts
Showing posts with label config. Show all posts

Tuesday, June 29, 2010

ASP.NET MVC 500.24 Error

This error occurs because Asp.Net cannot apply a detected setting in Integrated managed pipeline mode.

In the Web.config add this line of code in the [system.webserver] block.

[validation validateintegratedmodeconfiguration="false"]

This will ignore the error.


-------------------------


Also, in IIS web.config, in the system.web element, there is the identity impersonate=true element. Delete.

Wednesday, May 5, 2010

WCF Alternative Config with MEF

This website describes how to use an alternate config file with WCF.

http://weblogs.asp.net/cibrax/archive/2009/09/08/client-configuration-in-wcf-4-0.aspx

Basically, this is a way to do it, also.

ConfigurationChannelFactory factory = null;
try
{
string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
string configFile = path + @"\FOT.Services.Plugins.RAT.MainServer.dll.config";

ExeConfigurationFileMap configFileMap = new ExeConfigurationFileMap();
configFileMap.ExeConfigFilename = configFile;

Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configFileMap, ConfigurationUserLevel.None);

System.ServiceModel.EndpointAddress endPointAddress = new System.ServiceModel.EndpointAddress("net.tcp://" + rigIP + ":8052/SatelliteAuthorizationService");

factory = new ConfigurationChannelFactory("NetTcpBinding_IAuthorizationService", config, endPointAddress);

EventLogger.LogEvent(EventLogger.LogCode.Debug, EventLogger.LogLevel.Trace, id: "877", className: "Moderator", methodName: "CreateWell", eventMessage: "Loaded Config File.");
}
catch (Exception ex)
{
EventLogger.LogEvent(EventLogger.LogCode.Unknown_Error, EventLogger.LogLevel.Error, id: "881", className: "Moderator", methodName: "CreateWell", eventMessage: ex.Message, stackTrace: ex.StackTrace);
}
IAuthorizationService client = factory.CreateChannel();
int error = client.CreateWell(authorizationKey, Convert.ToInt32(wellId), databaseName, productType, productVersion);