Re: Sharing code between ASP.NET application and Windows service app in the same solution

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: NWx (test_at_test.com)
Date: 03/17/04


Date: Wed, 17 Mar 2004 23:06:46 +0200

Hi,

I followed your advice, and I managed to use that DLL into my project (Web
app so far)
I already set the project dependences in Solution properties, and set build
order.

However, I have another problem.

If I make a change in library project source (for example I add a parameter
to a method of a class) and rebuild the whole solution, the changes are not
visible automatically in web application.
Even if I copy myself the new DLL from library project to Web app bin
folder, the changes are not visible

The only way to see them was to remove reference to DLL and add it again

There is something I did wrong?

I use VS.NET 2002

Thank you

"Martin Dechev" <detcheff_@hotmail.com> wrote in message
news:uSZw95BDEHA.3408@tk2msftngp13.phx.gbl...
> Hi, NWx,
>
> Move the business logic layer code to a new Class Library project. Add
> reference to this project in both the web project and the service project.
> Change the method that uses the connection string to receive this string
as
> parameter. Then in the web project pass the stored value in the
web.config.
> In the service project either hard-code the value or create a .config file
> for the service and store the value in it.
>
> Hope this helps
> Martin
> "NWx" <test@test.com> wrote in message
> news:Oxo8IEBDEHA.3408@tk2msftngp13.phx.gbl...
> > 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
> >
> >
> >
> >
>
>



Relevant Pages

  • Re: Sharing code between ASP.NET application and Windows service app in the same solution
    ... and I managed to use that DLL into my project (Web ... I already set the project dependences in Solution properties, ... Even if I copy myself the new DLL from library project to Web app bin ... >> project, those files are actually copied to Windows service folder, So ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Sharing code between ASP.NET application and Windows service app in the same solution
    ... and I managed to use that DLL into my project (Web ... I already set the project dependences in Solution properties, ... Even if I copy myself the new DLL from library project to Web app bin ... >> project, those files are actually copied to Windows service folder, So ...
    (microsoft.public.dotnet.general)
  • Re: Firefox and Sound
    ... number of loads that app performed. ... only references to entry points in the dll. ... specified entry points in it can't be found, ... but the download manager said it was only 78.8 MB. ...
    (comp.os.os2.apps)
  • Re: New Delphi roadmap is coming: NO UNICODE PLEASE!
    ... Avoids DLL hell, because it ... The app is deployed and the user is getting an error. ... instances where upgrading .NET broke things that were working. ... Coming from Delphi, this isn't any big deal of course. ...
    (borland.public.delphi.non-technical)
  • Re: What programming language for Future
    ... usually when apps come with scripts, those scripts are for that version ... version of the app. ... Which is exactly the same as when the compiler is shipped with the app. ... for the sole reason that they can't rebuild a working dll. ...
    (comp.lang.misc)