MStest throwing errors for Class library using multiple config files I have created a class library MultipleConfigFiles, which has a method getConfigData. This method reads data from config files.      public class Class1     {       public string getConfigData()       {         string configData = ConfigurationManager.AppSettings["key"].ToString();         return configData;       }     }   Now I have a console application ConsoleAppConfig, in which I have given the reference of the class library.In the main method, I have created a object for the library class and called the method.  static void Main(string[] args)         {             Class1 c = new Class1();             string data = c.getConfigData();             Console.Write(data);             }   This console application has 2 different config files dev.config and prod.config. In the main App.config file , I have used configSource to map the appropriate config file.  &lt;appSettings configSource="dev.config" /&gt;   Dev.config file looks like this:  &lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;appSettings&gt;     &lt;add key="key" value="dev" /&gt; &lt;/appSettings&gt;   Till here it is working fine.That is, when I run the console app, the method returns dev.  Now,I have created a MSTest project for this class library.  public class Class1Tests     {         [TestMethod()]         public void getConfigDataTest()         {             Class1 obj = new Class1();             var result = obj.getConfigData();                         }     }   Now the problem is, when I run this test, it throws an error saying "An exception of type 'System.NullReferenceException' occurred in MultipleConfigFiles.dll but was not handled in user code. Additional information: Object reference not set to an instance of an object."  Since the config files are in ConsoleApplication , the method is not able to read the appsetting variables from there. Is there any way I can maintain the configuration files globally so that both of them use individually , or is there any better way to handle this.    Any inputs are appreciated.Thanks.
Can a unit test project load the target application's app.config file? I am unit testing a .NET application (.exe) that uses an app.config file to load configuration properties.  The unit test application itself does not have an app.config file.    When I try to unit test a method that utilizes any of the configuration properties, they return null.  I'm assuming this is because the unit test application is not going to load in the target application's app.config.  Is there a way to override this or do I have to write a script to copy the contents of the target app.config to a local app.config?     post kind-of asks this question but the author is really looking at it from a different angle than I am.  EDIT: I should mention that I'm using VS08 Team System for my unit tests.
The following integral should be doable using the residue theorum:     $$\frac1{2\pi}\int_{0}^{2\pi}e^{\cos\theta}\cos(n\theta) \,d\theta$$ What part of speech is there in the sentence “There is a book on the table?”  Also, while typing it out, another question pops up vis-à-vis punctuation. In my complete first sentence above, I ended it with a question mark since my main sentence is a question. The quote is not a question, but it looks like it because of the question mark. Is this the right way to punctuate? Good reasons to prohibit inheritance in Java? What are good reasons to prohibit inheritance in Java, for example by using final classes or classes using a single, private parameterless constructor? What are good reasons of making a method final? Is $(B_t^2)$ Markov where $(B_t)$ is Brownian motion? I am pretty sure $(B_{t}^{2})$ not Markov because the squared random walk is not.    I guess I can repeat the method since to be Markov it must satisfy the discrete.  Thanks Three files have suddenly appeared in my home directory, called "client_state.xml", "lockfile", and "time_stats_log". The last two are empty. I'm wondering how they got there. It's not the first time it has happened, but the last time was weeks ago; I deleted the files and nothing broke or complained. I haven't been able to think of what I was doing at the time reported by stat $filename. Is there any way I can find out where they came from?  Alternatively, is there a way to monitor the home directory (but not sub-directories) for the creation of files? Group of order 15 is abelian How do I prove group of order 15 is abelian?  Is there any general strategy to prove that a group of particular order(composite order) is abelian? Power Supply Capacity Formula Given that I am building a home computer from scratch and I have several components (MB, CPU, HDD, Video, Sound, etc) which have specific power requirements, is there a formula for me to calculate the size/capacity of the Power Supply I will need? I want to be able to expand the setup later on also... Why is the definite article used in expressions like the more and the less? For example,  The more you study, the more you know. The less you study, the less you know. How do I pack textures for sending off to a render farm Whenever i try to send a project off to a render farm such as sheepit, it says it needs the textures packing with the file in order to render correctly.  How would I do this? Can you please guide me best way to retrieve all active picklist values of all recordtypes of object. Can it be possible through API or any Apex Script.  I want something like below and i will write them in my file:  Obect Name, RecordTypeName, PicklistValues   Thanks Why don't I hear any sound after calling the Beep function in Windows 7? The question says to solve this equation: $(z+1)^5 = z^5$  I did. Just want to find out if I did it properly and if my run-around logic makes sense.  First I begin my writing the equations as:  $$ (z+1)^5 = z^5$$ $$ \mathbf{e}^{5 \mathbf{Log}(z+1)} = \mathbf{e}^{5 \mathbf{Log}(z)} $$ So $$  \mathbf{Log}(z+1) = \ln|z+1| + \mathbf{Arg}(z+1)i $$   $$  \mathbf{Log}(z) = \ln|z| + \mathbf{Arg}(z)i $$   Now, because the natural logarithm is one-to-one, I write:  $$ \ln |z| = \ln |z+1| \Rightarrow |z| = |z+1|$$   So assign $ z = a +bi$   So that $|z| = \sqrt{a^2 +b^2} = |z+1| = \sqrt{(a+1)^2 +b^2} \Rightarrow a^2 +b^2 = (a+1)^2 +b^2 \Rightarrow a^2 = (a+1)^2 \Rightarrow a = -\frac12 $  So, $z = -\frac12 + bi$ and $z+1 = \frac12 + bi$ for some $b \in \mathbb R$  Now to find $b$  $$ \mathbf{Arg}(z+1) = \mathbf{Arg}(z)$$ $$ \tan^{-1} \frac{b}{\frac12} = \pi - \tan^{-1}\frac{b}{-\frac12}$$  I have a feeling this last part isn't quite right, so I just want to find out if I'm approaching this question properly?  Ultimately, I get $ z = -\frac12$ which upon inspection...is wrong... Dr. StrangeNumbers or: How I Learned to Stop Worrying and Love Floating Point Arithmetic Beamer: PDF presentation viewer to play embedded videos and show elapsed time I have been suffering from finding a PDF presentation viewer for beamer output on Windows that can play embedded videos (by media9 package) and show the elapsed presentation time. I have tried the following: Adobe Reader with tdclock package:  Pros: plays videos and loads tdclock properly Cons: sluggish and crashes frequently  Foxit Reader with tdclock package:  Pros: smooth viewer and plays videos  Cons: can't load tdclock clock/stopwatch despite enabling javascript   Impressive:  Pros: fast and has internal clock  Cons: can't play embedded videos   Dual-Screen PDF Viewer:  Pros: very fast, has internal clock and dual screen support  Cons: can't play embedded videos   Is there any other solution that can properly play embedded videos and show elapsed presentation time flawlessly and smoothly on Windows?  P.S. when I mean tdclock javascript is not loaded, those empty red boxes show up instead of the clock/stopwatch,  and when embedded video can't be loaded, a white page shows up. How to create a procedural chevron like texture/material? I'm playing around with nodes within cycles and I'd love to create a chevron like texture like the image below. Anyone an idea how to accomplish this? How can I rewire half switched receptacles? In my bedroom the bottom half of all receptacles are controlled by one switch. Is it possible to have just one receptacle with top and bottom hot all the time?  The top half is hot all the time the bottom half is controlled by one switch.  Keep in mind there are six other receptacles in this room that are the same way controlled by the same switch. When I took the receptacle out the right side tab had been removed.  The top right screw had a black wire, the bottom right had a red wire, the top and bottom left screws had separate white wires.  I changed the receptacle out as suggested, I capped off the red wire and I capped off the white wire that was attached to the bottom left screw. I attached the other white wire to the top left screw and attached the black wire to the top right screw. I now have none of the receptacles working at all. What did I do wrong? From the Windows NT-based (Windows XP and 7 specifically) command prompt, how can I get the serial number of a hard drive as a variable? The one I'm looking at is the serial number of the physical hard disk drive Loopback to forwarded Public IP address from local network - Hairpin NAT This is a  about Hairpin NAT (Loopback NAT).   The generic form of this question is:  We have a network with clients, a server, and a NAT Router. There is port forwarding on the router to the server so some of it's services are available externally. We have DNS pointing to the external IP. Local network clients fail to connect, but external work.   Why does this fail? How can I create a unified naming scheme (DNS names which work both locally and externally)?   This question has answeres merged from multiple other questions. They originally referenced FreeBSD, D-Link, Microtik, and other equipment. They're all trying to solve the same problem however. If I have a Windows executable, how can I find out which dlls it will load?  I'm just talking about which ones that will be loaded statically, not ones it might load dynamically with something like LoadLibrary. How to explicitly discard an out argument?