.net

How to get log4net to generate log files when running as non-administrator user?

A process running as a non-administrator user does not have rights to write to the program files folder. What is the best way to configure log4net to write to a location that a non-administrator user has rights to? Ideally there would be: A single configuration file or configuration from code would work for all versions of MS Windows...

C# publish with visual studio dependance of dependance

Hello, My project1 references project2. In project2 I added some dll as link. However when I publish the project, the dll are not in the resulting folder. Is it possible to do this or I am doom to add the dll directly to the project1. ...

To get parent class using Reflection on C#

How I can get the name of the parent class of some class using Reflection on C#? ...

References for learning to write multi-threaded application in C#?

One of library I am working on, requires support of asynchronous operations. This library communicates with external devices using serial port (RS232) which can be quiet slow. I went through many MSDN articles but I am not feeling confident. I think if you are 100% sure that your multi-threaded application is thread-safe, then it might ...

From old DataLayer to LINQ to SQL / Entity Framework

There are a few "should I chose this or that" questions on SO and Google, as well as a lot comparing LINQ2SQL and LINQ2E. I've seen drawbacks, differences, cons, pros, limitations, etc. I cannot say I'm an expert but I'd like to know "what would you do" if you faced this scenario and why. I have to add stuff to an "old" 2.0 app that ha...

Removing certain XML elements via XSLT

Hi to every one. My problem is: I have an XML file where I want to remove some child elements without removing parents. Can anyone help me to get the result by using ASP.NET? Here is my XML file: <Jobs> <Job> <Title></Title> <Summary</Summary> <DateActive>9/28/2009</DateActive> <DateExpires>10/28/2009</DateExpires> ...

What is the simplest way to do background tasks in Windows.Forms?

Background tasks being stuff that involves network I/O, disk I/O, or other long-running tasks that may or may not take place over a network. It will often intermix with code that updates the GUI, which needs to be running on another thread, the GUI thread. Simple meaning that when opening a Form.cs file, the source code is as easy or e...

.NET Attachable Profiler

Hi All, Is there any process-attachable .NET profiler available? The problem faced is that I am currently wanting to profile an online-only ClickOnce application, which cannot be started any other way other than the website. Anybody have any ideas? Thanks, Kyle ...

looping through xml in .net

I'm looping through Some xml in .net and assigning Xml elements to string variables. Those variables are passed into a method that takes three arguments. That method runs a stored procedure in SQL Server 2005 that queries the database with those three arguments. The method and sproc run fine when passing in the arguments manually. But ...

displayind contents in list view

Ihave an xml file sample.xml i need to display number from above xml file in a listview named _listView which contain version column named _version,can you give me the optimized code required to do that task ...

importing excel data into access

My VB.NET application is using importing some excel sheet into access command.CommandText = "SELECT * INTO [MS Access;Database=" & current_db & "].[" & sheet_name & "] FROM [" & sheet_name & "$]" The problem is that if I have some cells with the green error message in excel they are not imported in access. And they are actually in the...

How do you make a user control property of type collection<string> editable/setable in visual studio designer

Hi, I have a custom user control (a webcontrol in this case) that has a property of type Collection public class example : public System.Web.UI.UserControl { public Collection<string> ThisIsTheCollection { get; set; } } I would like to be able to edit this property in designer when I add this control to a webform. It does show up...

How to Check if a String is a "string" or a RegEx?

How can I check if a String in an textbox is a plain String ore a RegEx? I'm searching through a text file line by line. Either by .Contains(Textbox.Text); or by Regex(Textbox.Text) Match(currentLine) (I know, syntax isn't working like this, it's just for presentation) Now my Program is supposed to autodetect if Textbox.Text is in f...

create fixed size thumbnail dynamically on listview control

how to create fixed size thumbnail dynamically and resize image in listview best fit the size of the thumbnail. private void Treeview1_AfterSelect(System.Object sender, System.Windows.Forms.TreeViewEventArgs e) { if (folder != null && System.IO.Directory.Exists(folder)) { try {...

Dynamically loading assemblies and their dependents using XCOPY deployment

Hi, I have an application loader that dynamically loads applications. An application is an assembly with all of its dependents in a single folder. Using XCOPY deployment I can add/remove applications by copying/deleting a folder. To facilitate standard .NET assembly binding I copy the application folders under the bin of the loader. I s...

XPath and XSLT 2.0 for .NET?

.NET 3.5 doesn't completely support XPATH 2.0 or XSLT 2.0, which is just too bad. Does anyone know if these two will be included and fully supported in any future .NET versions? ...

what are the <% %> constructs called in asp.net?

I am new to ASP.Net and I'm a little confused here. While learning ASP.Net through some of the articles online, I notice some of the experts using some keywords for binding data and auto incrementing a date in source code, like <%#Container.DataItemIndex + 1 %>, <%#Eval("Itemid")%>, <%#DataBinder.Eval(Container.DataItem, "itemStock")%>...

How do you tell the C# compiler that a symbol is a type and not a variable when they share the same name?

Hi, When you have a local variable named the same as a type, is there any way to tell the compiler that the symbol you have given is a type or a variable? For instance consider (and ignore all type return errors): public class sometype { public static sometype DoSomething() {} } public string sometype { get { return sometype.DoSometh...

Where are these dots coming from? How to get rid of them?

For the life of me, I don't know when and how these "dots" started showing up in my IDE. I'm not sure if it's Visual Studio OR Code Rush from DevExpress that is doing it. If anyone knows how to make them go away, please help! =) ...

Regex to check a string

Hi, I'm trying to check a string and then extract all the variables which starts with @. I can't find the appropriate regular expression to check the string. The string may start with @ or " and if it's started with " it should have a matching pair ". Example 1: "ip : "+@value1+"."+@value2+"."+@value3+"."+@value4 Example 2: @namePar...