.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

.NET Assembly with COM interface doesn't work in 64-bit windows

Posted By:      Posted Date: October 02, 2010    Points: 0   Category :.NET Framework


I've created a simple test DLL, written in C#, with a COM interface.

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace ComInterfaceTester
  public interface IMyClass1
    string GetAString(int aiNumber);

  public class MyClass1 : IMyClass1
    public MyClass1()



View Complete Post

More Related Resource Links

logoff doesn't work through windows service

Dear Friends, I am facing this problem on Windows 2003 and 2008 Server. On XP it works fine. I have written and Windows Service that takes receives the command and executes tasks such as Logoff, Shutdown, etc. All the commands except Logoff works fine. I tried following ways to perform the Logoff. However it didnt work. Try 1:                 Process.Start("shutdown", "-l"); Try 2:     [DllImport("user32.dll")]     public static extern int ExitWindowsEx(int uFlags, int dwReason);     ExitWindowsEx(0, 0); Try 3:     Process _currentProcess = new Process();                _currentProcess.StartInfo = new ProcessStartInfo("shutdown", "-l -f");                _currentProcess.StartInfo.UseShellExecute = false;                 _currentProcess.Start(); Try 4:     Process.Start("logoff.exe", null); If I write a simple C# based applicatin (not Service) it works fine for all the tries that I have made. I am facing this problem only when I put this code

Windows explorer view doesn't work on Windows 7

We are running Office SharePoint 2007 with SP2 on windows 2003 server. All windows 7 with IE 8 gets this message: " Please wait while Explorer View is loaded. If Explorer View does not appear, your browser may not support it". when click Windows Explorer in View. All Vista and XP work fine. I have tried these: 1. Added the SharePoint site on a Trusted Site. 2. Web Client is set to Automatically start, and that it is started. 3. We have Office 2003 installed on all computers. 4. We also tried to enable Comtability View. Is there a fix?Bob Lin, MS-MVP Networking, Internet, Routing, VPN Troubleshooting on http://www.ChicagoTech.net How to Setup Windows, Network, VPN & Remote Access on http://www.howtonetworking.com

SPD Workflows - Assembly redirection doesn't work

Hi, I'm migrating a solution from MOSS2007 to SharePoint 2010. I have, among others, custom workflow actions in a DLL deployed to the GAC (e.g. MyWorkflows.dll version My new solution contains new workflow actions that target the SharePoint 2010 API (e.g. MyWorkflows.dll version So what I'm doing is: - Creating a workflow in SPD in a MOSS2007 environment. Such workflow contains one of my custom actions. - Upgrading the environment to SharePoint 2010. - Removing the WSP package containing my files/DLLs that targeted MOSS2007 and deploying a new WSP containing the solution files that target SharePoint 2010. - Add assembly redirection entries in the web.config file of my web application, so that calls to MyWorkflows.dll get redirected to MyWorkflows.dll version (I also add other redirection entries regarding other stuff - for example, webparts). - Reset IIS and OWSTIMER.   After that I can see that the old webparts work fine (the assembly redirection seems to work for them). However, when I try to run a workflow (manually, from the browser) it doesn't work. I get the following error in the ULS log: Microsoft.SharePoint.SPException: <Error><CompilerError Line="15" Column="3" Text="Could not deserialize object. The type 'MyWorkflows.MyActivity' could not be resolved." /></Error>   &nbs

Windows Authentication doesn't work after change of admin pass



J have read many answers about

Login failed for user ''. The user is not associated with a trusted SQL server connection

error, but I don't want to mess up in my sql server so I want to be sure that what I do is OK.

Environment description:

In my company, we have our own application wchich we use to connect to database. All users use SQL Server Auth except me. I can log using Windows Auth from server and from my second computer.

Now everything works fine.

- My comp is in our domain 'OurDomian'.

- On server in AD is admin account 'SqlAdmin'.

- In MSSMS in Security->Logins there is account: OurDomian\SqlAdmin

- on my comp account OurDomian\SqlAdmin is added

I can log to sql server from  my comp using 'Integrated Security' in application with no problem.

Problem description:

Problem starts when I change SqlAdmin password on server.

When I connect from my comp I get the above error. But when I connect from server there is no problem.

I searcher application code and I don't think that I have to change somthing in it. Probably I have to change something with account and permissions.

1. Will it bee enough to delete and add again 'OurDomian\SqlAdmi

Windows Authentication Doesn't work properly



I've implemented Windows Authentication with kerberos protocol.

Each time user visit site they have to hit Sign in button and then they get logged in. IE doesn't recognized automatically user and signed in.

Thanks, Sam

MVC 3.0 Beta Bug: Windows Authentication doesn't work


Windows authentication doesn't works for me.

Here are steps to reproduce:

  1. Open VS2010
  2. Create an "ASP.NET MVC 3.0 Web Application" with the Empty template
  3. Add a HomeController controller.
  4. Change the authentication element in web.config to: <authentication mode="Windows" />
  5. Under project Properties > Web enable NTLM Authentication
  6. Add a break point inside HomeController.Index().
  7. Start debugging.

When the breakpoint is hit, I get:

User.Identity.AuthenticationType = ""
User.Identity.IsAuthenticated = false
User.Identity.Name = ""

When I follow the above steps with an "ASP.NET MVC 2.0 Empty Web Application" project, I get:

User.Identity.AuthenticationType = "NTLM"
User.Identity.IsAuthenticated = true
User.Identity.Name = "<My Username>"

which is correct.

New Graphical Interface: Enhance Your Programs with New Windows XP Shell Features


The Windows XP shell introduces many new features that both users and developers are sure to welcome. The interface supports a number of styles that will be new to users, and it also supports customization of those styles through a new concept called themes. There are more shell registry settings available to the user and developer, a facility for customizing infotips, and infotip shell extensions. In addition, folder views can be customized. This article covers these shell changes and includes a discussion of a number of other Windows XP additions. These include fast user switching, which lets users log on and off quickly, and AutoPlay support for a variety of devices and file types not previously supported.

Dino Esposito

MSDN Magazine November 2001

When I use 'publish', site doesn't work when i post data


Arrgghh, I am so tired of dealing with stuff like this

I've got a project, when I put up on another server I point two sites in IIS6 to it

i have

http://www.main.com  pointing to the folder the files are in


http://www.anotherofoursites.com/main pointing to that same folder in it's own "Virtual Application" or whatever IIS calls it when you put a folder into it's own 

If I just "Build" and push all the files up.. both work without issue and as expected...  but when I use "Publish" to precompile, the site works until I post, and then i get nailed with:

Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Ajax Asyncfileupload doesn't work as soon as I put it in a control


Hi guys,

I can't get my <ajax:asyncfileupload> working and I don't see why...

When outside any panel or table it is working well, but as soon as I put it in a <asp:panel> or table I get a strange error which seems to be on client-side but I don't understand what's happen here. Here is the code and code-behind and Javascript.

Here's the error: 


Here's my front-code:

<%@ Page Language="VB" MasterPageFile="~/masterpages/mpSqueletton.master" AutoEventWireup="false" CodeFile="frmAdmGestSocietes.aspx.vb" Inherits="adm_frmAdmGestSocietes" title="Untitled Page" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" Runat="Server">
<script type="text/javascript" language="javascript">    
        function uploadError(sender,args)
          document.getElementById("<%= lblStatus.ClientID %>").innerText = args.get_fileName(), "<span style='color:red;'>" + args.get_errorMes

AsyncPostBackTrigger doesn't work on server..


 I am new to asp.net and ajax. I have a problem while using update panel.
I have a tabcontainer with 3-4 tab panels. Inside one tab panel there is a cancel button. What i want to do is to when i hit cancel button in code behind i change active tab index to 0 so that tabcontainer shows first tab panel. I have update panel around tab container. This works at my localhost. But on server its behavior is very random. Sometimes it works sometime it doesn't. Unfortunately I am not able to debug it also. I don't know how to debug code on server. As on localhost it works correctly so I am kind of stuck. 

Asyncfileupload doesn't work in webusercontrol

I'm having a problem with a Webusercontrol that has an asyncfileupload control. My websusercontrol is being loaded in a placeholder control that's wrapped by an updatepanel.Due to asyncpostback, I have to load and clear the placeholder's controls. The webusercontrol works flawlessly, except the asyncfileupload, which doesn't want to upload at all. I can assure that the code is without error, because I used to have the webusercontrol running as an *.aspx site. I guess that the problem is the fact that the control has to be cleared and reloaded with every asyncpostback ?

Getting AppDomain.UnhandledException event to work in a Windows Service

Nearly every forum thread I have found on "catching unhandled exceptions in a service" seems to end up where I am.  The supposed solution is the use of the AppDomain.CurrentDomain.UnhandledException event.  But it doesn't work for someone, who then asks why and gets no answer.  Same for me; I can't get the event to happen.  It's as if I need the ServiceProcess version of Application.SetUnhandledExceptionMode(), which doesn't exist. For diagnosing this, I start a timer in a child object of the service and then throw an exception in the timer event handler.  Simple enough to simulate the real situation.  I have tried subscribing to the UnhandledException event in at least a half dozen locations throughout the service, from the Program that runs ServiceBase.Run() to the constructor of the object that owns the Timer, but it never catches this exception. The VS debugger recognizes that the forced exception is unhandled and takes me to the place where is thrown, letting me know it is an unhandled exception. Why doesn't my handler catch it?  Running without the debugger, the exception throws, the timer thread crashes, the service continues merrily along, and nothing gets logged anywhere.  That is NOT the result I need.  What are the people for whom this works doing that I am not doing? How can I at least get the offe

Windows 7 64bit Registry access using x86 assembly

Hi guys, I have an assembly that is complied in x86 release mode. The assembly tries to access  a particular registry key in Win7 the key is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion  -> ProductID(tried to read this value) As the assembly is in x86 it tries to look for the key in SysWow64 node HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion -> ProductID(tried to read this value) When i went through the registry i found that the string "ProductID" is missing (!) .. (may be because i have trial version of windows 7 x64)? I just wanted to ask , is there a way to read registry key (not in wow6432node ) HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion  -> ProductID  in x86 mode? Im using the following  code RegistryKey regkey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", false); //reads in wow6432Node for x86 assembly string strProductID = string.empty; if (((regkey != null))) { // Get key Value of ProductId. strProductID = (string)regkey.GetValue("ProductId"); if ((string.IsNullOrEmpty(strProductID))) { //try reading another path for "ProductID" } } return strProductID ; PS:When i complie the same assembly as "Any Cpu" , the above code returns corr

Getting my sql database app to work on any windows pc

Hello I have just made a vb.net database application using visual studio 2008 with the service based database component. The application works fine on my pc but when i copy my application and the .mdf file and test it on another windows pc that does not have visual studio 2008 installed it  says that sql server is not propery configured and or is missing. I am just wondering how I can configure the sql server so that my application can read,save,add, delete my stored data on any pc. I tried to install the sqlsetup files but I still get the same error message. Would appreciate if someone could give some hints or help with this issue. Thanks!    

doesn't work (using IIS 6.0)

HiI'm getting errors with an application on our test web server, which has .NET 4.0 installed, when I input HTML into a form.  I get the usual errors of:A potentially dangerous Request.Form value was detected from the clientThis is being caused by the change in .NET 4.0 that disables switching off automatic validation for HTML input.I can fix this on my local development machine by adding the <httpRuntime requestValidationMode="2.0" /> directive to the <system.web> section of my root web.config, and .NET then honours the <pages validateRequest="false" /> directive that's in the same root web.config.  Strangely, I needed to restart IIS on my local machine (which is version 5.1) for this change to work.When I deploy the root web.config to our test server however, I'm still getting the validation errors.  I've tried using run > iisreset, stopping and starting IIS (which is version 6.0 on the test server), and I've even restarted the server to fully clear out .NET.  My application is definitely picking up the new root web.config (I've tested this), however the <httpRuntime requestValidationMode="2.0" /> directive seems to just be ignored.My application is configured as a  .NET 4.0 application on both my local machine and on the test server.  I've tried rebuilding the a

Workflow doesn't work anymore after renaming list

Hi All, I have created a list with the name "helpdesk test". After testing this list i renamed the list to "helpdesk". I did the rename by the list settings.  To this list i attached some workflows, with Sharepoint designer,  that have to start when a new item is created. All worked fine but after the rename the workflows don't work anymore. When i start the workflows manually from the list all works fine. Is there a way to rename a list and let the workflows work as before? Thanks in advance. Laurens.      
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend