.net

Which layer should be responsible from loading plugins?

I've got an application with 2 main components + other DLLs: Core DLL (got all core functionality) GUI 3rd Party and Totally Independent DLLs which requires for DI etc. Now I'm implementing plugin support. Which DLL should be responsible from loading these plugins? GUI or the Core DLL? I'm using MEF so not quite sure where to sti...

Get value between two substrings using regex

If I have a string "Param1=value1;Param2=value2;Param3=val3", how can I get the value between the substrings "Param2=" and the next semicolon (or end of string, whichever comes first)?" ...

What does "Object reference not set to an instance of an object" mean?

I am receiving this error and I'm not sure what it means? Object reference not set to an instance of an object. ...

What are some clever uses of LINQ?

What are some clever uses for LINQ outside of LINQ to SQL? Have you found any problems that LINQ made a whole lot easier to solve? Please post examples. ...

Programmatically managing Microsoft Access Attachment-typed field with C#.NET

Access added a new data type in the 2007 version--the Attachment type. We are currently working on a WinForms application with .NET 3.5 (C#) that uses an Access 2007 database. We want to be able to add new attachments through the WinForms interface. I can't seem to locate any information on how to insert or select attachment data with .N...

Is there a cross-platform GUI framework for C#/.NET?

Let's say just for the joy of it, I decide that I don't want to write desktop applications in Java any more, instead want to switch to using C#. I want to be able to build an application that will run on some mainstream Linux distribution, and a recent release of MS Windows. It will have a GUI component. In Java I can build an applic...

How to specify folder structure with msbuild copy task

I have the following msbuild script that copies the entire DeploymentDirectory to the VersionSpecificDirectory. Here is the snippet: <CreateItem Include="$(DeploymentDirectory)/**/*.*" > <Output ItemName="AllDeploymentFilesToCopy" TaskParameter="Include" /> </CreateItem> <Copy SourceFiles="@(AllDeploymentFilesToCopy)" Destinati...

How do I restart my C# WinForm Application?

Developing a C# .NET 2.0 WinForm Application. Need the application to close and restart itself. Application.Restart(); The above method has proven to be unreliable. What is a better way to restart the application? ...

How might I insert some JavaScript into the document of a WebBrowser control?

I'm using the System.Windows.Forms.WebBrowser control in a .NET 2.0 application, and would like to insert a bit of JavaScript code into the loaded document right before the end of the body element. How might I go about accomplishing this? ...

Open Source Projects that make use of Pex

Hi, I am interested in finding out more about the use of Pex, the testing framework for .NET. I am aware that the current version of Pex is only 0.11, but is anyone aware of an open source project that currently makes use of it? Thanks, MagicAndi. Update - Results So Far QuickGraph Functional-dotnet ...

If basic types are object, why can't we do this?

So for complex types, we can write: return new MyType ( 5 ); but why can't we do stuff like (to have symmetry for one): return new int ( 5 ); return new Int64 ( 5 ); I know only parameterless constructors are provided. What's the reason for this? ...

Magento Web Service Errors

I am implimenting a custom solution to interface with a Magento website. My code is in C#. I am trying to create products using either the v2_soap api and the xml-rpc api web services. I have attempted to create a product using both services. I cannot seem to successfully create a product. With each service I receive the error message “ ...

Thread safety object - Static or not? (.NET)

I was recently in an Interview and the tech guy asked me about how to make teh app thread safe. Well, after explaining the lock() correctly, he said it is not a good idea to have the object as static. private static readonly object _syncLock = new object(); He claimed the reason is that static makes that object slower for threads to ...

How to use imagemagick in asp.net website?

I am building a new website and it will contain a lot of image manipulations and i found imagemagick which seams very good, but the problem as a .Net developer i can't integrate it in my website. Is it possible to use in .Net application/websites? How to add to reference and which file to add? Any good examples? ...

Does .NET support Windows Eventing 6.0 ?

I want to use the Windows Eventing 6 API from a C# application to log messages to a specific channel in Windows Server 2008 event log. There is a good example on how to use it but it's only C++. In the example it's mentioned that .NET doesn't support Windows Eventing 6. There are 2 examples in http://msdn.microsoft.com/en-us/magazine/cc1...

Why is LINQ to SQL inserting duplicates into my table?

I have a web service that retrieves reviews from my database and if not enough reviews are returned, it goes to a secondary source and gets them there and caches them in my database. I have recently noticed that it has been creating duplicates in my database despite me having primary keys to prevent it. I was thinking that maybe when I m...

.Net is increasing my development time - am I missing something?

I recently started playing with C#, but I am finding it very frustrating. It seems every time I want to add what I think is a simple control, I end up either scouring the internet or writing my own. I just feel like I spend more time recreating controls to get them to work the way they should, and less time actually creating applicatio...

Please suggest some great websites for a .NET programmer.

Hi, I'm new to world of .NET programming and I want to know about websites that have articles, tips and other useful information about .NET and Microsoft technologies. The websites I currently visit are: MSDN StackOverflow WindowsClient.NET TheServerSide.NET I'd love to learn about some new .NET websites! Thanks, Ek ...

Is Int32^ i = gcnew Int32() allocated on managed heap?

Basically I would like to know the difference between Int32^ i = gcnew Int32(); and Int32* i2 = new Int32(); I have written the following code: #include <stdio.h> #using <mscorlib.dll> using namespace System; int main(void) { Int32^ i = gcnew Int32(); Int32* i2 = new Int32(); printf("%p %d\n", i2, *i2); pr...

Optimal buffer size for response stream of HttpWebResponse

What's the optimal buffer size to use with a stream from HttpWebResponse.GetResponseStream()? Online examples vary from 256b to as much as 5Kb. What gives? I guess buffer sizes might be situational. If so what are the situations to use what type of buffer size? Thanks. ...