.net

How to register a winservice?

how to register a windows service within c#.net? ...

Is there a way to produce a binary diff on two byte arrays in c# .net?

I am trying to compare two byte arrays in memory and produce a data structure to hold the differences so that with byte array B and the data structure holding the differences it is possible to recreate byte array A. The size of the byte arrays are always identical and are relatively small. The byte arrays represent bitmaps which typica...

List Types bypassing ReadOnly Properties?

When using custom classes with read-only properties that are of type List or similar (ie, ObservableCollection), it is still possible to 'get' the variable and call an Add() method on it to alter the content. Is there a way to stop this (without creating huge overloads of the List class) on 'external' access, or is it 'best practice' t...

What is the difference between SSCLI 2.0 (ROTOR) and .NET?

Is there a large difference between the SSCLI 2.0 and .NET, I know that Microsoft wouldn't release their garbage collector or JIT compiler and simpler implementations are used, but as far as the rest is concerned is there much difference? ...

asp.net mvc clearing a form after post

I'm a .net programmer, but new to mvc. I created a new mvc page with a simple form on it - 2 textboxes and a submit button. Upon posting, it goes to my server side method, where the user info is entered into the db, and then I want to return the user to the same exact form but empty again. When I use "return View("Index", new myIndexOb...

Linq, emulating joins, and the Include method

Hello, I'm looking into an issue that is related to... http://stackoverflow.com/questions/416847/join-and-include-in-entity-framework Basically the following query returns the list of "Property" objects the current user has permissions ( ACLs ) to view. IQueryable<Property> currPropList = from p in ve.Property ...

How to sort a binding source with joins?

I have a table called Tenants, and it has a field called PropertyID and UnitID. I also have a binding source for this table (Tenants), however I want it sort it, but the values I want to sort it by are not in the table itself. I want to do something like this: SELECT t.*, p.PropertyName, u.UnitNumber FROM Tenants t LEFT JOIN Propertie...

What is the best way to organize file version migration code?

I'm writing a plug-in for another program through an API. To save it's current state, my plugin stores an instance of a Project object to the file by serializing it to XML and storing it in a user string, a feature provided by the API. It also stores a separate string that contains the version number of the plug-in currently being used. ...

Why is this program in error? `Object synchronization method was called from an unsynchronized block of code`

What is wrong with this code? i get a 'Object synchronization method was called from an unsynchronized block of code'. I found one result on google that said i may be releasing a mutex before locking but according to my output this is not the case. Here is the mutex code without the other code in between. -edit- sorry guys, wrong paste....

MVC not rendering model properties in text box

I'm using MVC to create a few simple CRUD pages. I have a stringly typed user control which I include in my Create and Edit views which looks like this: <% using (Html.BeginForm()) {%> <div class="form"> <%:this.Model.Title%> <p> <label for="Title">Title:</label> <%= Html.TextBox("Title", this.Model.Title) %> ...

How to properly prompt the user when closing an MDI form and children?

I'm writing an IRC client, where there is an MDI parent with Server and Channel windows. When you close a Server window, it prompts the user and if they want to close it, the connection to the server is closed etc. I would like there to be only one prompt when the MDI parent is closed rather than a prompt for each server. The problem is...

Is threre a way to get cookies without reading entire page?

I am trying to post some data and get some data back from a website. The site does not expose any webservices or API's and I have no way of modifying the site. The only option is HTML screen scraping. In order to post the data, I first need to log in, get a cookie go to another page get another cookie and go to the final page to post the...

Prevent too much information from being revealed during profiling of application that uses my .net assembly

Hello, I have created a .Net assembly and when running an application that uses my assembly through a profiler like jetbrains dottrace, a lot of information is being revealed about my assembly (private methods etc..) (no source code though). Is there anyway to prevent that ? ...

How do I include full PartCover results with TeamCity 5?

Hi, I'm trying to get PartCover reports to generate correctly in TeamCity 5.0. When I click the Code Coverage tab in the build details, the reports are empty. I'm using the sln2008 build agent and my PartCoverage settings are as follows: Include Patterns: [*]* Report XSLT: C:\Program Files\PartCover .NET 2.3\xslt\Report By Assemb...

Linq to Sql not submitting changes to database file in console app

I have an issue with my Linq to SQL Data Context no submitting in my console application. The following code is all that there is in the main() method. BlogRollerDataContext bdc = new BlogRollerDataContext(); bdc.Urls.InsertOnSubmit(new Url() { Approved = false, UrlTo = "http://www.google.com/", UrlFrom =...

C#: Resolving Invalid Cast Exception Between an Inherited Class and Its Base

I have two classes, named Post and Question. Question is defined as: public class Question : Post { //... } My Question class does not override any members of Post, it just expresses a few other ones. What I want to accomplish I have an object of type Post, whose members are populated. Now, I want to convert it into a Question, so...

Where can I take .NET courses in San Francisco?

I hope this question is considered programing related. I've been learning and using .NET for my job for over a year now. I've been using it to write plug-ins for programs we use in the office and a couple stand alone utilities. I don't work at a tech company, so there are very few people at the company that I can get any support from. Th...

Is there a documentation of what is contained in web.config

Providing support to application that runs on ASP.NET framework reads application level web.config file. I know apart from this there are is machine level web.config and another one. Sometimes customers make changes to machine level web.config for some reason. Is there a complete documentation of each configuration/parameter available in...

Problem creating SqlDataSource for GridView

Trying to create a SqlDataSource in Visual Studio 2005. When I specify my source database, which is a SQLServer 2008 database, I get a valid connection but receive the error message that the datasource must be SqlServer 2005 beta or above when I click continue, i.e. go to the configure page of the wizard. wtf ...

PInvoke returns C type with union

How would I P/Invoke a C function which returns a union'ed struct? ...