dantheanswerman
asked on
IIS7.0 C#.NET Web Application Migration Visual Studio 2008 Errors
We have a working copy and this all works currently in our IIS 6.0 Web Server. (So we know the code works, but when we migrated to IIS7.0, the following references do not work):
We are migrating a server from IIS6 to IIS7 and when we publish from Visual Studio 2008, most references work fine, but the following does not:
Our Data Access Objects (.cs) have the following references to a constants file in another project (which is referenced via a "using" directive.
the "Constants.DbName" is not being recognized in the DAO :
__________________________ __________ __________ _
__________ __________ ___
which references the following "constants.cs" (bear in mind -- this works great in production as we speak, but will not work in IIS7.0 on our brand new server.
__________________________ __________ __________ _
__________________________ __________ __________ _
the ARQDB references the web.config file:
Begin web.config file code
__________________________ __________ __________ _
__________________________ __________ __________ _
end web.config file code
We are migrating a server from IIS6 to IIS7 and when we publish from Visual Studio 2008, most references work fine, but the following does not:
Our Data Access Objects (.cs) have the following references to a constants file in another project (which is referenced via a "using" directive.
the "Constants.DbName" is not being recognized in the DAO :
__________________________
public string deleteLINMapping(string parentLIN, string childLIN)
{
string todo = "";
try
{
Database db = DatabaseFactory.CreateDatabase(Constants.DbName);
DbCommand cmd = db.GetStoredProcCommand("stp_Admin_Delete_ChildLIN");
db.AddInParameter(cmd, "@parentLIN", DbType.String, parentLIN);
db.AddInParameter(cmd, "@childLIN", DbType.String, childLIN);
db.ExecuteNonQuery(cmd);
}
catch (Exception e)
{
bool rethrow = ExceptionPolicy.HandleException(e, Constants.DAOExceptionPolicy);
if (rethrow)
throw e;
}
finally
{
}
return todo;
}
__________________________which references the following "constants.cs" (bear in mind -- this works great in production as we speak, but will not work in IIS7.0 on our brand new server.
__________________________
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
namespace NGB.ARQ
{
public static class Constants
{
public static string DbName = "DBName1";
public static string DAOExceptionPolicy = "Exception Policy";
public static string ARQSecurityExceptionPolicy = "Exception Policy";
public static string ExcelExceptionPolicy = "Exception Policy";
#region URL Names
public static string URL_NotAuthorized = "URL_NotAuthorized";
public static string URL_Logout = "URL_Logout";
#endregion
#region IMG Header
public static string folderPath = HttpContext.Current.Request.ApplicationPath;
public static string filePath = HttpContext.Current.Request.PhysicalPath;
public static string IMAGE_RMQLogo2CamoFiller = "IMAGE_RMQLogo2CamoFiller";
public static string IMAGE_Spacer = "IMAGE_Spacer";
#endregion
#region FiscalYear
public const string FYPLUS2 = "2012";
public const string FYPLUS3 = "2013";
#endregion
}
}
__________________________
the ARQDB references the web.config file:
Begin web.config file code
__________________________
//FROM web.config file
<connectionStrings>
<add name="DBName1" connectionString="Database=MYDB;Server=SQLDBNAME;uid=######;pwd=#######;" providerName="System.Data.SqlClient"/>
</connectionStrings>
__________________________
end web.config file code
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER