How do I allow assembly (unit testing one) to access internal properties of another assembly ?
I would like my Core assembly to not expose a certain class and I would still like to be able to test it. How can I do that ? ...
I would like my Core assembly to not expose a certain class and I would still like to be able to test it. How can I do that ? ...
Perhaps I need to define "dynamic generation". By this I mean using graphics primitives to draw on the page (such as DrawText or DrawLine, etc) This is what System.Drawing.Printing provides. I often need to create forms and reports for Windows applications that either require dynamic generation or where I need control over the formattin...
I need to design a small project for generating excel reports in .NET, which will be sent to users to use. The excel reports will contain PivotTables. I don't have much experience with them, but I can think of three implementation alternatives: Set a query for it, populate it, send it disconnected. This way the user will be able to g...
Is there a way of getting all required assemblies (excluding the .net framework) for a .net project into a folder ready to be packaged into an nsis as setup file? I've tried writing a small console app that uses reflection to get a list of dlls but have got stuck with finding a foolproof way of determining if a dll is from the .net fram...
Does anyone know of any good library that abstracts the problem of path manipulation in a nice way? I'd like to be able to combine and parse paths with arbitrary separators ('/' or ':' for example) without reinventing the wheel. It's a shame that System.IO.Path isn't more reusable. Thanks ...
How can I tell from the assemblyName, or Assembly class (or others like it), whether an assembly is part of the .net framework (ie System.windows.Forms)? So far I've considered the PublicKeyToken, and CodeBase properties, but these are not always the same for the whole framework. Edit: The reason I want this info is to get a list of ...
I need to check programmatically (in .NET) whether a given user (domain account) is a member of the built-in Administrators group on a current computer (the one where the application gets executed). Is it possible? ...
So, I know that try/catch does add some overhead and therefore isn't a good way of controlling process flow, but where does this overhead come from and what is it's actual impact? ...
Using the obsolete System.Web.Mail sending email works fine, here's the code snippet: Public Shared Sub send(ByVal recipent As String, ByVal from As String, ByVal subject As String, ByVal body As String) Try Dim Message As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage Message.To = recipen...
What are the different ways (programatically & otherwise) to determine what versions of .NET are running on a system? ...
Can I return it as an object if I'm doing a Select OneItem from Table Where OtherItem = "blah"? Is there a better way to do this? I'm building a constructor to return an object based on its name rather than its ID ...
I have to use a third-party component without source code. I have the release DLL and release PDB file. Let's call it 'CorporateComponent.dll'. My own code creates objects from this DLL and calls methods on these objects. CorpObject o = new CorpObject(); Int32 result = o.DoSomethingLousy(); While debugging, the method 'DoSomethingLous...
I would like to "post-process" my app.config file and perform some token replacements after the project builds. Is there an easy way to do this using a VS post-build event command? (Yeah I know I could probably use NAnt or something, looking for something simple.) ...
What is best practice when creating your exception classes in a .NET solution: To derive from System.Exception or from System.ApplicationException? ...
Is there a way to get the path for the assembly in which the current code resides? I do not want the path of the calling assembly, just the one containing the code. Basically my unit test needs to read some xml test files which are located relative to the dll. I want the path to always resolve correctly regardless of whether the tes...
I've had a Windows app in production for a while now, and have it set up to send us error reports when it throws exceptions. Most of these are fairly descriptive and help me find the problem very quickly (I use the MS Application Exception Block). On a few occasions I have reports that are issues that I can't reproduce, and seem to onl...
System.IO.Directory.GetFiles() returns a string[]. What is the default sort order for the returned values? I'm assuming by name, but if so how much does the current culture effect it? Can you change it to something like creation date? Update: MSDN points out that the sort order is not guaranteed for .Net 3.5, but the 2.0 version of ...
I have a treeview control in a Windows Forms project that has checkboxes turned on. Because the treeview control has nested nodes, I need the checkboxes to be able to have some sort of tri-mode selection. I can't find a way to do this (I can only have the checkboxes fully checked or unchecked). ...
Visual Studio Solution files contain two GUID's per project entry. I figure one of them is from the AssemblyInfo.cs Does anyone know for sure where these come from, and what they are used for? ...
We are currently looking to adopt some type of "standard" developer framework and have looked into using the Enterprise Library. Would you recommend using these blocks as the foundation for software development, or should we do something home grown? ...