.net

How can I keep a VB.NET class in a central location and reference it from multiple websites?

We have several VB.NET websites running internal applications. These sites are often modified with minor changes, and are maintained on the server as uncompiled code. I'm looking for the best way to maintain classes so that we can reference them from multiple websites. Specifically, we're looking to put some common functions (error lo...

ASP Configuration Error in <authentication mode="Windows" />

I get that error when trying to "view in browser" from an aspx file in Visual Studio 2008. The complication to the problem is that I'm not actually on the server itself, its a project that's been checked out from source control onto my local machine. I've seen the solution for the problem if I were on the server but my computer is not ...

Finding what database column an entity's property is mapped to.

I was wondering if anyone knew how to find what column an entity's property is mapped to using NHibernate and only having the IEntityPersister interface available. ...

ContextMenuStrip Custom Layout

I'm trying to have a Windows Forms ContextMenuStrip control display a list of countries, about 200 total. Currently it displays them all vertically which creates for a long wait time to scroll to countries near the bottom of the list. I've tried messing with the ContextMenuStrip.LayoutStyle property but it hasn't gotten me anywhere. M...

Windows Workflow for product licensing state?

I'm working on the licensing component of a commercial product, and I'm trying to make sure all of our complicated licensing modes work seamlessly. I'm considering using a WWF state machine to keep track of the licensing state so we can be sure the software accurately follows the product licensing terms we state to our users. I've alread...

What is the most efficient way to make multiple (parallel) requests against a web service using WCF?

I have a WCF service client and it was generated using the /async argument with svcutil.exe, so it uses the asynchronous programming model. When I make multiple asynchronous requests with a single client though it serializes the execution of those requests. Here is an example that shows how I am executing the parellel requests. [TestM...

Hosting a WCF(mex endpoint) service inside a windows service on windows 2008

I'm hosting a WCF service inside a windows hosted service. When I start the WHS, I get the following error: The ChannelDispatcher at 'net.tcp://mysecreturl/' with contract(s) '"IClass"' is unable to open its IChannelListener. System.InvalidOperationException: A registration already exists for URI 'net.tcp://mysecreturl/Indexer/'. ...

Dependency injection Container per request

Hi, It is very common to create Dependency Injection container for the ASP.NET application so it lives while the application lives. I create the DI container in each request and release it at the end of the request. The main purpose is that any DI container supports Disposing objects when the container gets disposed. Additional: ...

TabControl Add very slow

I have a C# Windows Forms app. I have a TabControl on it, and depending on user settings, will dynamically use TabControl.Controls.Add to add a specific set of TabPages to the tabs. The TabPages aren't special, they just have buttons and text. Doing this dynamically, even for small amount of tabs, is slow as hell. Every "Add" call, o...

Using generic Dictionary over wcf: what do I need to look for?

Suppose I have a WCF service and a method in the contract <ServiceContract()> _ Interface IThingService '... <OperationContract()> _ Function GetThing(thingId As Guid) As Thing End Interface where Thing is an ordinary class with ordinary properties, except for one member: Public Class Thing ' ... Public Property Photos() As ...

Do multiple entries for the same assembly in web.config cause initial start time to increase?

Can having multiply entries for the same assembly in the web.config cause an increase in the initial start time of an ASP.NET application? For example: <add assembly="ESRI.ArcGIS.ADF.Web.DataSources, Version=9.2.2.1380, Culture=neutral, PublicKeyToken=8FC3CC631E44AD86"/> <add assembly="ESRI.ArcGIS.ADF.Web.DataSources, Version=9.2.2.138...

.NET - Reliably Maintaining File System from an Application

I have a mixed application that has data both in a database and in a physical file store maintained by my application. As I have been developing my application I have, on occasion, run into scenarios where I am moving or deleting a file from the hard drive through my application and for whatever reason something will go wrong and an exce...

Overriding C# Conditional statements problem

I was writing some code today and something was not working as I expected. Why does the following code execute even though the condition should have evaluated to false? I have tried putting braces around the two conditions, and switching their position, but the EndedUsingApplication even still executes. EDIT: It has nothing to do w...

How sure is to create a USB security key using PnPDeviveID?

I need to protect software using a USB key. Can I just query a USB drive with WMI and obtain the PnPDeviceId from Win32_DiskDrive Class, and compare it with one already hashed and hard coded in the application? How secure is this? Can the PNPDeviceID property be modified? Is hardware coded? Any other idea? Logically the USB drives are g...

.NET Runtime version 2.0.50727.3082 - Fatal Execution Engine Error

I found a couple posts regarding this error on StackOverflow and posts on various forums. There doesn't seem to be any one cause or solution for this error. So that it might help somebody else, below is the text of an email I sent to DevExpress regarding my experience with this error. === A month or two ago I installed an update to the...

Technology to Prevent Multiple logins to the Same Computer

I re-asked this question here because the people at ServerFault deemed that this is the appropriate place to ask this. I am trying to prevent people from multiple login into one single computer and use my application simultaneously. In other words I want to prevent it from running twice on the same computer, at the same time In any giv...

Get .NET type declaring an interface

Let's assume type MyType implements interface IMyInterface. How to find type declaring an interface ? For example, class UnitTest { MyTypeBase : IMyInterface { } MyType : MyTypeBase { } void Test() { Type declaration = FindDeclaration(typeof(MyType), typeof(IMyInterface)); Assert.AreEqual(typeof(MyTypeBase), declarati...

DIsable tooltip in project

Is there a method to globally disable the tooltips in a .net project Visual studio 2008. We have implemented tooltip in the web apps, but would like to turn it off for testing. ...

How to find if app has been installed before?

Is it possible for a .NET application to leave a trace so that it can be found if the application is re-installed? Of course, a trace that is difficult to be removed. ...

Cleaning up static references

Hi, I have static class with static dictionary with some informations. The dictionary has key as WeakReference (i don't want prevent garbage collection of the real key object ). Code sample: public static class ThreadHelper { private static readonly object syncRoot = new object(); private static Dictionary<WeakReference, Thread...