.net

How to handle authorization when using NHibernate in .NET

I'm using the repository pattern to query our database using NHibernate. It makes it really easy to do things like: public T GetById(int id) {...} But that doesn't help much when someone start mucking with the querystrings to see things they aren't allowed to. To compound it, some objects are deeply nested children of the parent obje...

Method vs ReadOnly property?

When should I use a readonly property as opposed to a parameterless method? ...

.NET - What IoC Container framework would you recommend to a beginner in this area?

What Inversion of Control Container framework would you recommend to a beginner in this area? ...

Targeting 64-bit

I'm building a web application on .Net and it will run on 64 bit server. Is there something special that I should do to take full advantage of 64 bits? Only thing that comes to mind is that RAM is cheap and "unlimited" for 64bit, maybe I should cache as much as possible. Edit: closing as duplicate of http://stackoverflow.com/questions...

Access to Modified Closure (2)

This is an extension of question from Access to Modified Closure. I just want to verify if the following is actually safe enough for production use. List<string> lists = new List<string>(); //Code to retrieve lists from DB foreach (string list in lists) { Button btn = new Button(); btn.Click += new EventHandler(delegate { MessageBox....

Recommendations for Automated Translation Tools for .NET

Hi there, I'm currently working on an ASP.NET 2.0 web application that basically maintains product catalogs. The product descriptions are now in English, and we already designed the application to store the same descriptions in multiple languages as well (like Spanish or French). Given the scenario that we would like to translate a pro...

Anyone uses ASP .NET Membership?

Was wandering if anyone uses ASP .NET membership? If you do, tell me what you think about it. If you don't use it, Are you planning to use it on future projects? If not, why? RWendi ...

Will the .Net Entity Framework work with a .mdb?

Can use a .mdb file as the data source for an Entity Framework model using the Microsoft Jet OLEDB data provider? If so, how will I be limited? No stored procedures, for example. ...

PostgreSQL or MS SQL Server?

I'm considering using PostgreSQL with a .Net web app. Basically 3 reasons: Mature Geo Queries Small footprint + Linux Price I'm wondering a bit about tools though, SQL Server Profiler and query plans and performance monitors have been helpful. How is this world with Postgres? Some other things I should consider? Edit: Will most like...

How to cleanly reuse edit / new views in Asp.NET MVC

I'm trying to avoid code like this when reusing the same ViewUserControl in ASP.NET MVC. Any suggestions? <% if (ViewContext.ViewData["editMode"].ToString() == "edit"){ %> <%= Html.SubmitButton("submit", "Update Brand")%><span class="or">Or</span><a href="#" class="cancel">Cancel</a> <% } else { %> <%= Html.SubmitButton("submit"...

F# programming books.

I already know of Expert F#, does anyone know of any other books related to F#? Thanks in advance. ...

Problems finding an attribute attached to a Type

When running the below code a type is never returned, despite there being a class with the correct attribute assigned. In fact the attr array always has a length of 0. Assembly a = Assembly.LoadFile(file); foreach (Type t in a.GetTypes()) { object[] attr = t.GetCustomAttributes(typeof(SchemeNameAttribute), false); foreach (obje...

Does the CLR automatically detect if the garbage collector should be run in server mode?

From a previous question I have seen that the CLR has workstation and server modes for its garbage collector. I know that these can be set from configuration using the gcServer element. If you don't specify this, does the CLR use some magic to decide for you whether the garbage collector should run in server mode? Something based on C...

Does using delegates slow down my .NET programs?

Does using delegates slow down my programs? I've been avoiding them because I really have no clue if they make my programs any slower. I know if I cause a (catch) exception, that uses quite a bit of CPU power but I don't know about Delegates and Events and what .NET does to them. ...

Detect whether IIS is Enabled

Hi Is there a way to detect whether IIS is enabled or not? I know how to check if it is INSTALLED, but I need to know if it's installed but not enabled. Also, can this be done natively via InstallShield? Checking this via .NET would be acceptable as we can write custom actions, but if there is an IS call then that would be ideal. An...

Why do SelectedIndices and SelectedItems not work when ListView is instantiated in unit test?

I'm writing this question in the spirit of answering your own questions, since I found a solution to the problem, but if anyone has a better solution I would gladly listen to it. In the application I am currently working on I am subclassing the ListView control to add some functionality of which some interacts with the ListView Selected...

Is it legal and possible to access the return value in a finally block?

I wish to set a usererror string before leaving a function, depending on the return code and variable in the function. I currently have: Dim RetVal as RetType try ... if ... then RetVal = RetType.FailedParse end try endif ... finally select case RetVal case ... UserStr = ... end select end try ret...

Should I distribute log4net with my releases?

I am wondering what is best practice when it comes to dependencies and how releases should be done. In my case I have a library that relies on log4net and I am wondering if I should distribute log4net.dll (set the log4net reference to copy local) along with the release? Could I simply state that log4net should be installed in the GAC? ...

Best practices for referencing 3rd party assemblies

I have been wondering what are best practices when it comes to referencing 3rd party assemblies. A while ago I asked a question "Dependencies and references: what exactly should I reference" and received something to think about but I am not completely convinced. I have a 3rd party assembly needed for building my project and according to...

Detecting dependencies between namespaces in .NET

Are there any utilities that can examine a set of managed assemblies and tell you whether any of the types in one namespace depend on any in another? For example, say I have a MyApp.BusinessRules namespace and don't want it to access directly anything in MyApp.GUI, but both namespaces are in the same assembly. My goal is to be able to w...