.net

Framework version used by .NET Framework 3.5

I am trying to determine the version of the .NET framework that a dll is using. I have targeted 3.5 in my app but when I open the dll with ildasm.exe (on my dev PC with 3.5 installed), it says it is using "Metadata version: v2.0.50727" which is it really using? ...

Calling a delphi DLL method from C# Code

I am trying to call a Delphi function from C# ASP.NET code. The function's declaration looks like this: function SomeFunction(const someString, SomeOtherString: string): OleVariant; From my C# code I have this code: [DLLImport(MyDLL.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)] public static extern obj...

Better to serialize NHibernate DetachedCriteria or LINQ-to-NHibernate expressions over WCF?

What I'd like to do: 1. Create an arbitrary LINQ query based on user-selected criteria that will 2. Query against a proxy collection (facade) that 3. Converts the query to NHibernate DetachedCriteria and serializes OR just serializes the LINQ expression and then 4. Sends the serialized query to the server via WCF, where 5. The service im...

ASP.NET request validation causes: is there a list?

Hello, is anybody aware of a list of exactly what triggers ASP.NET's HttpRequestValidationException? [This is behind the common error: "A potentially dangerous Request.Form value was detected," etc.] I've checked here, around the Web, and MSDN Library but can't find this documented. I'm aware of some ways to generate the error, but woul...

Which IOC runs in medium trust

Hi I am trying to get a website running with Mosso that has Castle Windsor as my IOC, however I am getting the following error. [SecurityException: That assembly does not allow partially trusted callers.] GoldMine.WindsorControllerFactory..ctor() in WindsorControllerFactory.cs:33 GoldMine.MvcApplication.Application_Start() in Glob...

List of buttons?!

I've been working on a small program which gets a list of url's from the web server ( latest forum topics ) and warns the user whenever a new topic is created. So the main form of my program have a list of buttons. Each button has the text of the forum topic and extra information below. Opens the browser with the topics url when user p...

Confused about version numbers of references within my .NET application...

I have a .NET project which references a DLL called ABCPDF. The version number used when the application was written is 7.0.2.3 and the application was deployed onto a staging server. The version of the software on the staging server is 7.0.2.8 and the application is breaking saying that it cannot find version 7.0.2.3 Surely it should ...

Is there a way to prevent a ToolWindow from being closed?

Is there a way to hide the "X" closing icon of a ToolWindow or is there a way to use IVsWindowFrameNotify3's OnShow method to discard (ignore) the event? It seems that the OnClose method is called only when VS exit. When the ToolWindow is called, the OnShow method is called with the __FRAMESHOW.FRAMESHOW_WinHidden state. thanks ...

ThreadPool.QueueUserWorkItem - strange behaviour (Asp.Net)

I'm currently using ThreadPool.QueueUserWorkItem in an Asp.Net application. Basically a user uploads a file using a form with an FileUpload Control. The file can take quite a while to process which was causing a time out for the user and also making the UI unusable while the upload was processing. So I thought I'd just call my import me...

Problem with entity framework with inheritance, condition, and foreign key.

I just started to play around with Linq to entities and ran into an issue I can't figure out. I know this doesn't tell everything but to make it easier to understand here is a screen shot of the culprit... I am getting this error: Condition member 'RelatedResources.TypeID' with a condition other than 'IsNull=False' is mapped. Either r...

ControlPaint.DrawBorder().....but thicker!?!?

I have the below code, which works, to draw a border around a control in a WinForm 3.5 app. What I can't figure out is how to THICKEN the border that is being drawn. I tried Inflate(5,5) on the ClientRectangle but that actually made the Border disappear all together versus making it thicker. I get the impression that I actually need...

How to make a System.Drawing.Image semitransparent?

System.Drawing.Graphics.DrawImage pastes one image on another. But I couldn't find a transparency option. I have already drawn everything I want in the image, I only want to make it translucent (alpha-transparency) ...

Is there any way to have functions in basic T4 templates?

By basic T4 template, I mean not using T4 Toolkit or any of the add-ins. My T4 is getting a little complicated, but I'd like to keep in self-contained for now. Is there a way have functions in your T4 template, without referencing external assemblies? ...

Should I map a DTO to/from a domain entity on both client and server sides?

I've got a rich domain model, where most classes have some behaviour and some properties that are either calculated or expose the properties of member objects (which is to say that the values of these properties are never persisted). My client speaks to the server only via WCF. As such, for each domain entity, I have a corresponding DT...

Determine if a Url is absolute or relative from vb

I'm trying to determine in vb if a URL is absolute or relative. I'm sure there has to be some library that can do this but I'm not sure which. Basically I need to be able to analyze a string such as 'relative/path' and or 'http://www.absolutepath.com/subpage' and determine whether it is absolute or relative. Thanks in advance. -Ben ...

How do I programmatically login into a website that does not return an html response using c#? Tried using HttpWebRequest but it hangs when I call GetResponse()

Hi, I am trying to programmatically login into a website ("http://www.smscountry.com") using C#, but the program hangs at the second GetResponse() request, where I try to login by POST method and filling the form fields. public String GetWebContent(String username, String password) { //The URL of the Login Form ...

WCF Service browser.

Hi, What is the best way to achieve something like the SQL Server Browser but for WCF services running on the local network? I don't necessarily want to be able to browse for any and all WCF services, but rather for a service which has been coded to be browse-able. ...

Confused on Getting an int out of a var from Linq2Sql

I am just learning Linq and ran into a problem. For some validation, I am getting the last odometer reading from our database and need to compare that to the next reading. The odometer reading is an int on the incoming data and double on the database (changed to int on the dbml file). Below is my code: private bool IsValidOdometer(stri...

Entity Framework: ObjectContext.ExecuteStoreQuery produces detached objects

I need to run some custom SQL to return a list of objects from a table. I'm using ExecuteStoreQuery for that. var q = context.ExecuteStoreQuery<ProductionUnit>(MySelectString, new SqlParameter("@ProductionUnitId", value)); This does result in q containing an ObjectResult collection, but the actual ProductionUnit elements are Detached ...

.Net Remoting: Can the server reference an interface rather than the object?

Hi all, I am using .Net Remoting in an unusual manner whereby a single client will access many servers (this is unavoidable). To increase maintainability, it would be handy to have the server code reference an interface rather than the remoting object itself so that if a change to the remoting object is needed only the client needs to b...