Error while loading ASP page with activex COM components - com

We have deployed one classic ASP web application to our web server (Windows 2000 advanced server with SP4) say server Y.
We have COM components on the same server which we create from DLL's build on some other machine. For eg. we build DLL's on machine X and then copy these DLL's to server Y and build COM components refering to those DLL's on server Y.
Now if we run the application URL from machine X - say URL would be "http://(server Y)/app.asp" It just worked fine with loading of all relative activex components; BUT if we run the URL from any other machine we receive error as "ActiveX component can't create object".
kindly suggest!
Thanks,
Ravin

Just copying your COM components .dlls doesn't work. You need to register the COM component on all machines you want them to run on.
Run
regsvr32 C:\<full path>\<your component>.dll
on your machine Y to register the COM component.

Related

How to locally run .Net Core 2.0 app in VS Code the same way Visual Studio does with SSL

So, we have a web app we've migrated to .net core, and while it runs fine in Visual Studio 2017, because Visual Studio uses its "launchSettings.json" file to configure how IIS Express will work/launch - I, for the life of me, cannot figure out how to get VS Code to run the project. The problem is, we use HTTPS only and have always just let IIS Express used the self-signed locahost cert to allow this, so when debugging the site locally, we'd always use https://localhost:44300. As stated, this worked fine when entering this url in the launchSerttings.json file for Visual Studio, but VS Code does not use this, and the only answers I can find on this always refer to having to use the Kestrel Server's .Listen() method and used a self-signed cert and password to allow the use of an HTTPS port. 1) this seems just silly that I'd have to add this "test" code to run it locally, because I don't need it when we deploy to Azure, as Azure manages the certs and url for us. 2) Visual Studio 2017 does not need any specification on Kestrel to make this all work. So, I have hard time believing there isn't some extension, or process to achieve the same thing in Visual Studio Code that Visual Studio is doing under the hood to allow IIS Express to communicate with the .Net Core Kestrel Server.
Combing through the all the documentation suggests that the ASPNetCoreModule is what handles this communication for IIS and Kestrel, so, I would hope/guess there has to be some way to configure the web.config file's tag to include something that would make this work.
I've previously used and tried other IIS execution extensions in VS Code, but those focus on elements in the project's web.config to boot IIS which are no longer present in the web.config due to it being a .Net Core app. I had been successfully running the web app with the IIS Express Executor extension before migrating to .Net Core when the web app was a .NET Framework 4.5.2 app
So, the end goal is that I need to be able to go to https://localhost:44300 in the browser, and have our site work, but I don't want to have to add any sort of test-cert into the Kestrel config in the Program.cs or Startup.cs files. If there's no way to do this, then that will be really disappointing considering Visual Studio makes this seem like it should be very simple.
Thanks for the help.
Was able to get this to work using the following steps.
1) Install IIS Express executer in VS Code or any other similiar extension that wraps around dotnet commands
2) Download Process Explorer from https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer
3) Launch Visual Studio IIS Express as you would normally
4) Open Process Explorer (may need to launch as Admin) and locate iisexpress.exe -> VSIISExeLauncher.exe
5) Right click VSIISExeLauncher.exe and click properties then locate the "Environment" tab. Inside the environment tab you will see 2 variables: LAUNCHER_PATH and LAUNCHER_ARGS. Copy both of these variables and values.
6) Next locate the configuration file for the extension you installed in VS code (mine is launch.json inside the .vscode folder in your project root directory). It will likely have an "environment" or "env" section for adding environment variables to the launch arguments. Add the two arguments copied from step 5. These vary from person to person so the value of the arguments will be unique to your machine.
7) Launch IIS-Express from vs code. My particular command for this is "IIS-EE: Start IIS Express Server" but will vary based on the extension you installed. You can hit F1 to launch commands.
Visual Studio itself uses too many tricks under the hood to make you believe it is simple. However, it is not.
I documented all necessary details in a blog post,
https://blog.lextudio.com/how-visual-studio-launches-iis-express-to-debug-asp-net-core-apps-d7fd3677e3c3
And if you follow the steps manually, you should be able to launch IIS Express the same way VS does, and then use that in Visual Studio Code. I know there is some VSCode extensions trying to integrate with IIS and IIS Express, but I do hope those authors spend more time learning such integration and improve their extensions to fully support the scenarios.

RunTime errorError - ActiveX component can't create object - in an MS ACCESS application

I was trying to run a MS-ACCESS application (MS OFFICE 2007) which was written in VBA and connects to IBM MQ in a Windows 2012 R2 server. While doing so, I am getting the below error -
RunTime errorError - ActiveX component can't create object
When I debug the same, its pointing the error at the below
Set MQS = New MQSession
I've even registered MQAX200.dll using regsvr32.
The same app running finely on Windows 2003 R2 server - MS OFFICE 2007 - IBM MQ Version 7.5
I am sort of doomed right now. Can you please help me if I am missing anything..??
Thank you in advance.
Some things that you may want to check:
Going from a 32bit OS in Server 2003 to a 64bit in Server 2012, so there are 2 different regsvr methods to register libraries. You may want to read the answers in this link, possibly unregister the dll & then do it again just to make sure you did it properly:
How do I register a DLL file on Windows 7 64-bit?
Assuming that's out of the way, you may need to remove the VBA reference to the prior version of MQ, then reference the new version.
You mentioned Server 2003 had Office 2007 on it, does the new server have Office installed or is Access trying to reach the MQ app via unc path or drive letter?
Is VBA looking for a specific drive letter/path that is now different?
You can always fire up Access, create a new project, add the reference to MQ, then in the VBA try to instantiate the object to determine if you get a better error code you can research.
Don't forget to check the Event Viewer for supllemental info on what caused the failed instantiation

Configuration file for .Net COM when invoked from old ASP

there! I have a library written with .Net Framework 4. This library exposes some objects as COM via System.Runtime.InteropServices, which are registered with the regasm utility. These objects are intended to be used by an old (not .Net) ASP page, which is configured under an application that runs .Net Framework 2 (I know!!!) on IIS6 (Windows Server 2003).
Everything seems to work, except for the configuration file. When the .Net 4 COM object attempts to access System.Configuration.ConfigurationManager looking for a connection string, it gets a Null Reference exception. The web site has a Web.config file, and obviously the connection string is there, but the library can't find it. I think that it's because the Web.config is for the .Net applications running under IIS, and the COM library is seen as an external component.
I don't know where else the library might be looking for a configuration file. Changing the machine.config in the FW4 folder works, but I'd like to know if there is another location I could use, because machine.config is system wide and I don't want to pollute that, especially with connection strings. I tried adding a mylibrary.dll.config file in the DLL folder, but it doesn't work either.
Thanks in advance

Full trust in .Net framework 4.0

I am working on .Net framework.
I have created an application that creates a custom culture in my local computer. (Since it is a test application, it'll not be shipped or deployed anywhere else than my computer)
When I try to register the custom culture, it tries to access C:\widows\Globalization folder. I am getting UnauthorizedAccessException.
.Net Framework 4.0 doesn't provide .Net Configuration tool as earlier versions did.
What is the method to know the permissions provided to an assembly?
How to provide full trust to an assembly?
You already have full trust if you're running from your local drive (which you most likely are). In this case, the problem is that you need to be an Administrator. If you're running on Vista or Windows 7, make sure you right-click you .exe and select "Run as Administrator".

vb.net - keeping program updated?

I'm looking for suggestions on keeping a program that is running on a network updated. Installation consists of 15 users, each have the program on their local pc, but they all access same date from sql server.
I am looking for a clean method that would allow me to update one folder on the network and for each computer to get updated when they run the program and the programs sees a later ver on that folder on the network. (Obviously I can do this inside the program itself since it won't allow being overwritten while opened.)
You should have a look at
ClickOnce is a deployment technology
that enables self-updating
Windows-based applications that can be
installed and run with minimal user
interaction.
Using ClickOnce Deployment in
VB.NET
ClickOnce - A new VB.NET 2005 Deployment Tool
ClickOnce Deployment for Windows Forms Applications
ClickOnce Deployment in .NET Framework 2.0
Another option is to create a second program that will check the network for an updated version of your application. Let's call this program "updater.exe".
You can run updater.exe on system startup like Adobe Reader or Sun Java do.
Or, when your application is started it can load updater.exe. If updater.exe finds an update, it can close/unload your application, download the newer version, restart your application and close itself.
astander's answer above is correct, you can use ClickOnce for this. Another option is creating this application as a web application.
Web applications basically work the way you described, the application's files reside in a web server, all the users connect to it using a browser, and to update the application you only need to update the files in the server.