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 :
public string deleteLINMapping(string parentLIN, string childLIN)
            string todo = "";
                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);
            catch (Exception e)
                bool rethrow = ExceptionPolicy.HandleException(e, Constants.DAOExceptionPolicy);

                if (rethrow)
                    throw e;

            return todo;   

Open in new window

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";

            #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";


            #region FiscalYear
            public const string FYPLUS2 = "2012";
            public const string FYPLUS3 = "2013";

Open in new window

the ARQDB references the web.config file:

Begin web.config file code

//FROM web.config file
		<add name="DBName1" connectionString="Database=MYDB;Server=SQLDBNAME;uid=######;pwd=#######;" providerName="System.Data.SqlClient"/>

Open in new window

end web.config file code
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I do not know your environment and so could certainly be wrong but referencing a dll should not be an issue due to IIS7. Let me guess a few things and hopefully this will be helpful.

1. This is probably a dumb question but I am sure you have verified that the other dll (one that contains Constants.cs) exists in the same directory as the called dll. Or the other dll should be signed and registered in gac.
2. Move the code constants.cs into your main dll (the one that contains data access object) temporarily and see if that fixes the problem. If not, then something other than library referencing is the main issue.
3. Another option is to hardcode the database name and see if that fixes the problem.
4. This is unrelated to the problem you are facing, but please make sure ASP.Net is registered on IIS.
5. Looks like you are using Enterprise Library for exception handling and logging. Please attach the log file portion (IIS log or any other application log) that shows that the constants file is not being recognized.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dantheanswermanAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft IIS Web Server

From novice to tech pro — start learning today.