|
lets say i have a dll which relies on nhibernate or log4net. And within this dll there're calls which references these external library (nhibernate/log4net .. etc).
To be specific, and as an example I may have a dll (say it will be referenced by a ASPNET app AND a Winform App) and its app.config file look like this:
<configuration>
<configsections>
<sectiongroup name="spring">
<section name="context">
type ="Spring.Context.Support.ContextHandler, Spring.Core"/>
<section name="objects">
type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
</section></section></sectiongroup>
<section name="nhibernate">
type="System.Configuration.NameValueSectionHandler, System,
Version=1.0.5000.0,Culture=neutral,
PublicKeyToken=b77a5c561934e089" />
<section name="log4net">
type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</section></section></configsections>
<spring>
<context><resource uri="config://spring/objects" /></context>
<objects>
</objects>
</spring>
<nhibernate>
... nhibernate config ...
</nhibernate>
<log4net>
... log4net config ...
</log4net>
</configuration>
I want avoid having to copy app.config setting from my DLL when I reference my DLL from a console app this time, then next time to a ASPNET or WebService. Each time having to merge/cut/paste app.config (from Dll) seems like a waste of time.
Thanks
dev
|
|
|
|
|
What you can do is place config sections in a separate config file. Then you can copy the file as a whole rather than copy and paste sections of your app/web.config file.
In your app/web.config file you can refer to the other file like this:
e.g.
<connectionStrings configSource="data.config" />
|
|
|
|
|
|
|
|
|
amardeep deshmukh wrote: I will display all the versions of application installed on the clients machine- By looking in the Registry
How do you find the application from the registry? Do you use HKEY_CLASSES_ROOT?
|
|
|
|
|
|
Now we are a bit off from my area, but if you know either CLSID or ProgId, there are functions for COM like ProgIDFromCLSID and CLSIDFromProgID. However, I don't know if they work for the guid in Uninstall-path. I've understood that for example Microsoft Office is just one entry in Uninstall but it has several com components for all products (word, excel etc).
AFAIK installer keeps it's own inventory under HKEY_CLASSES_ROOT\Installer\Products. Also all CLSID's are under HKEY_CLASSES_ROOT\ClSID. In products folder most products have Transforms entry and the guid in that seem to reference to the installation folder in SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.
That's about all I could come up with.
|
|
|
|
|
|
amardeep deshmukh wrote: I got the workaround to this problem
Very good
|
|
|
|
|
Hi
I am having a problem with the order of the columns in my data grid. I have set the order I want in the data grid property Edit Columns. When I run the project 2 columns are way out of position. I tried to move the out of position column using column order but it is ignored. I then tried coding the position using event private void GridDisplayOrder(). I listed all rows in order from left to right. I get the message object reference not set to an instance of an object. Not sure how to get around this error. Here is the event I use
private void GridDisplayOrder()
{
Grid_Property.Columns["pContract_NO"].DisplayIndex = 0;
Grid_Property.Columns["pProperty_ID"].DisplayIndex = 1;
Grid_Property.Columns["pVersion"].DisplayIndex = 2;
etc
etc
any assistance would be appreciated
modified on Thursday, January 8, 2009 10:55 AM
|
|
|
|
|
Hi
Currently i am doing the SVN commit and SVN update of TortoiseSVN in directory folder alone. Instead of doing this. how to do same thing in VS2005 IDE.
Please help
Gopal
|
|
|
|
|
Gopal_Kanchana wrote: how to do same thing in VS2005 IDE.
You need VisualSVN[^] which is a plug in for Visual Studio.
|
|
|
|
|
I am going to create a custom control and want to add an ability. When it get focused then It appearance should change through GDI.
for example I am creating custom label.
Then how will i get my target.
Problem is that I am only able to change the object at Paint event, here I can make changes to my object through GDI but I want When my object get focus or it is being clicked then I want to make changes via GDI.
Any hint will be appreciated.
|
|
|
|
|
can you not just invalidate the control when you handle other events such as click?
userControl1.Invalidate();
this will cause the control to repaint itself, in which it will call the Paint event
|
|
|
|
|
is it C# support macro like c++? if not Why ? is it any standard they are following.
In C++ we can do MUL(X,Y) X*Y like this.
|
|
|
|
|
|
Thanks. this is a exact link.
|
|
|
|
|
These are different languages, with different features, that's it.
This question is kinda like a holywar starter
Regards,
Lev
|
|
|
|
|
|
0) Just because you *can* do something in C++, doesn't mean you should.
1) Macros can be used to circumvent the strong typing requirements of C++. Side effects are possible, and that's bad.
2) Macros cannot be debugged.
Macros that contain code are evil and should be avoided whenever possible.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Have to agree on all points. Macros are about the most evil feature C/C++ have to offer. The looong, late, sleepless nights dealing with macro expansion bugs...what a night terror.
All I can say is, THANK GOD C# doesn't have macros!!
|
|
|
|
|
Using macros, you can redesign your coding 'language' on the fly until your code doesn't even remotely look like C++. If you've seen as much bad C++ as I have, you know why many consider macros evil.
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
VB & C# to Java Converter
Java to VB & C# Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++
|
|
|
|
|
This is not a question, but is too short to be an article. Learn from my mistake.
Yesterday, I was testing a windows service I wrote using Visual Studio 2008 on a Windows 2000 machine. I had originally targeted .Net 3.5 when I created the project, and had to re-target the assemblies to 2.0 before installing it on the target machine. When I installed it, the event log would say that the service started successfully, but a few seconds later, I would get an error event - an invalid operation exception.
I removed EVERYTHING from the service except a keep-alive thread so it would keep running once installed, and it still threw the exception.
Thinking it might e a flaw in VS2008 when changing from .Net 3.5 to .Net 2.0, I tried creating an entirely new solution targeting .Net 2.0 from the start. It still threw the exception. And then I had an epiphany.
The installer class sets the name of the service. One thing that all windows services do (when you create them with the VS2008 template) is calls the InitializeComponent() method. I had always deleted this call in prior services I had written since it seemed like a pointless thing to do, but this time, I had left the call in. In InitializeComponent , it tries to set the service name to "Service1". This is NOT the name I gave it in the installer object. After changing the name to the same thing I used in the Installer object, it worked just fine - no exceptions.
When I changed the name of the service.cs file, I guess it missed that string in the re-factoring process. I spent four hours on this problem. BTW, the other fix for this would have been to NOT call InitializeComponent .
[EDIT] BTW, I had tested this service on my own Vista box, and it worked fine. While I was waiting for access to the Win2K box, I figured I'd fix the Service name (because it was showing up as "Service1" in the event log). I re-factored and compiled, but did not re-test it before trying it on the Win2K box (I figured the re-factor would have done what it was supposed to do). The lesson here? ALWAYS RE-TEST, NO MATTER HOW MINOR THE CHANGE IS PERCEIVED TO BE. This is proof that even the programmers with 30 years in the industry make the most rookie kind of mistakes every once in a while.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
modified on Thursday, January 8, 2009 7:25 AM
|
|
|
|