.net

NullReferenceException while calling WebMethod

I have the following problem; My console app is running on the server and all I want to do is control it over ASP.NET Web Service. I added new ASP.NET Web Service project to my Solution where my main console app and added reference to it. The problem is every time WebMethod calls function from console app, i get the nullreferenceexcep...

Why does a .NET application prevent Windows from shutting down?

One of my applications prevents windows from shutting down if it is running. The only spot where I suspect the cause may be is FormClosing event handler, which is however quite standard: EDIT: Removing this handler does not change the situation at all so the cause is somewhere else. private void MainForm_FormClosing(object sender, For...

uploading files in ASP.NET MVC

When I select a file and submit the file for upload, I can't get the value of the File path in my Model. In the Controller it shows as null. What am I doing wrong? View <form method="post" action="/Account/Profile" enctype="multipart/form-data"> <label>Load photo: </label> <input type="file" name="filePath" id="file" /> <in...

Excel Programming: Exception from HRESULT: 0x800A753F at Microsoft.office.Interop

I have an application which opens,reads and creates Excel files. The app has been written in C#. The error named in the title does not always show up, sometimes it is working as intended. May be someone can point me to the cause of the error. Googling did not make me smarter on this one. By the way, is there some kind of overview of HRE...

Good Learning Material on Parallel Extension of .Net 4

Can anybody please suggest me some good learning materials on the new Parallel Extensions and its use in .Net 4 except the MSDN one, so that I can learn - parallel programming on .Net 4 the basic differences between non-parallel and parallel programming paradigms how to create data-structures that supports parallel computation? Any f...

How to install "Web Application Project support" for Visual Studio 2010 ?

My root problem is that I get the following error message from my CruiseControl server : errorMSB4019: The imported project "C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. I know all i have to do to workaround this issue is to copy the files to the folder but I ju...

Changing Entity accessibility

I want to make an entity internal. I've changed entity, its scalar properties and navigation properties to internal. I'm getting this error when I try to build it: Error 6036: EntityType 'File' has 'Internal' accessibility and EntitySet 'Files' has a get property with 'Public' accessibility. EntitySet's get property must not have less r...

Decoding a tag in ASP.NET MVC

I'd like to know if there is an alternative for this in ASP.NET MVC: <input type="file" name="filePath" id="file" /> I would like to have it with some code sample: <%= Html.TextAreaFor(m => m.FilePath,1,32,null)%> ...

Is there a CPU emulator or a way to see how things are created and Destroyed in Memory

Ok, This question is not exactly a programming question but this is what can really make programming more practical and easy to implement. This question is coming out beacuase each-time I write int c=10; or MyClass objMyClass=new MyClass(); I want to see where in the memory the value has been created (Though We can see the address as a...

Steps and involvement of implementing a parser (in .Net - and in this case XPath 2.0)

Hi, In the lack of any good free XPath 2.0 implementations for .Net build upon Linq to XML I have thought about implementing my own (also for the experience). But just to be clear (and not building something that exists) these are the XPath 2.0 implementations I have found: Saxon .Net Query Machine - I had problems with this - excepti...

How can I force all tests to have a single category in NUnit?

I'm using NUnit 2.5.3, but if a more recent version of NUnit solves my problem, it won't be an issue to upgrade. We have a couple of different categories for tests. Different categories of tests will be run during different flavours of build (fast running unit tests for checkins, all unit tests and other tests with external dependencies...

Why is my custom property grid not showing a file name picker?

I derived a class from ICustomTypeDescriptor, and in the GetProperties method I return a PropertyDescriptorCollection collection of CustomProperty. Here is the relevant part of my CustomProperty class: (i know it's a bit crude, but everything else works including the DateTime picker) ref class CustomProperty : PropertyDescriptor { ...

Code before foreach loop does not execute.

Yay I finally thought of a title! I have a foreach loop that iterates the ListViewItems and does something with each item. But the problem is not that it doesn't do the work in the loop, but it simply does not execute any code that appears before the foreach loop. Below is the full method: private void pNGToolStripMenuItem_Click(o...

LINQ to SQL filter by List<int>

Hello, How can I retreive rows from table only when UserId is in my Users list ? Code below doesnt work :/ List<int> selectedSourceUsers = ... MyModelDataContext context = ... e.Result = from u in context.Users from id in selectedSourceUsers where u.UserId == id select u; Tha...

Good book for understanding DotNet internals

Hello, i would like to buy and study a good book that explains deeply all Microsoft DotNet internals (CLR,CTS,etc). Can you suggest me some titles? Thanks and greetings ! c. ...

Python's urllib equivalent in .net

Is there a .net equivalent for urllib I used in Python? I've seen WebRequest and WebResponse classes but I wonder if there is a simpler wrapper. In urllib you can use dictionary object (tupple) to set POST parameters while in .Net one must fiddle with streams. Is there any free, small web client library available for .net? ...

.NET 4 Async WebRequest Vs Mutiple Threads

I'm using C# .NET 4 and MSSQL. I'm writing a code that downloads the html of different websites and analyses it using Regex. Most of the time it takes the code to execute is waiting for the website html download to finish. Currently i'm using Task.Factory.StartNew to create multiple threads that call DownloadHtml() . DownloadHtml use...

ANTS Memory Profiler - Which memory should I be looking at?

Hi All, I have a memory issue on my websites and am trying to get to the bottom of it. I have downloaded the 14 day trial of ANTS Memory Profiler and have been playing with it to get a grip of what it's telling me. In the memory options on the timeline, I can see Bytes in All Heaps and Private Bytes etc but I am not sure which ones I sh...

Wait as long for 100 miliseconds for data returned from method else throw exeception

How can i have any kind of data returned from a method or property within a time frame, and if any data is returned within that time frame an exception is thrown? Pretty much I have a simple method that will perform a simple task, once performed the method returns a value, and if any value is returned within 100 milliseconds I want that...

.NET WebRequest Throttling

I'm using C# .NET 4 and MSSQL. The code uses WebRequest to download the html of different websites. The code is multi threaded. I want to limit the number of requests per mintue for a pre-defined list of domains. For example Domain: www.domain1.com Request Per Min : 5 Domain: www.domain2.com Request Per Min : 20 i saw some questio...