N
NWx
Hi,
I have a solution with two projects - an ASP.NET application, and a Windows
service
ASP.NET application was developed first, and for it I wrote some classes in
a Business logic layer
I want to share the same code with the Windows service, but if I drag the
BLL subfolder with all files form Web application project to Windows service
project, those files are actually copied to Windows service folder, So in
this case I'll have two copies of them and if I want to add some code, I
have to make changes in both places.
Is there any way to really "share" the source file between the two
applications? How?
And another issue
In those classes, I use SQL helper class to connect to database.
In Web application I pass the connection string, with a line as follows
myDS = SqlHelper.ExecuteDataset(
ConfigurationSettings.AppSettings(Global.CfgKeyConnString),
CommandType.StoredProcedure,
"MyMethod", ...)
But this uses a constant CfgKeyConnString, defined in ASP.NET Global
application object
The win service doesn't have this object. How can I solve this, to use
exactly the same code to retrieve different settings from configuration file
My thought is to create public class in Win service, assign it to a
variable named Global, and define some constants in that class.
Does anyone have a better thought?
Thank you
I have a solution with two projects - an ASP.NET application, and a Windows
service
ASP.NET application was developed first, and for it I wrote some classes in
a Business logic layer
I want to share the same code with the Windows service, but if I drag the
BLL subfolder with all files form Web application project to Windows service
project, those files are actually copied to Windows service folder, So in
this case I'll have two copies of them and if I want to add some code, I
have to make changes in both places.
Is there any way to really "share" the source file between the two
applications? How?
And another issue
In those classes, I use SQL helper class to connect to database.
In Web application I pass the connection string, with a line as follows
myDS = SqlHelper.ExecuteDataset(
ConfigurationSettings.AppSettings(Global.CfgKeyConnString),
CommandType.StoredProcedure,
"MyMethod", ...)
But this uses a constant CfgKeyConnString, defined in ASP.NET Global
application object
The win service doesn't have this object. How can I solve this, to use
exactly the same code to retrieve different settings from configuration file
My thought is to create public class in Win service, assign it to a
variable named Global, and define some constants in that class.
Does anyone have a better thought?
Thank you