I am moving a Classic ASP site from a Windows 2000 server to a Windows 2008 (both dev and prod). I have a .dll that was created in .NET 1.1. The error is occurring when function created in JScript located in this securityUtility.asp creates an ActiveXobject using the dll. The line looks as follows:
function getProfileFromLdap(user, pw){
var aClass, aProfile
aClass = new ActiveXObject("com.co.comp.security.ldap.LDAPLogin");
...
}
The error that is occurring is:
error '80070002'
E:\SITES\WWW-COMPANYSITE-COM\SITE\BINS../../siteInc/securityUtility.asp, line 850
I had run the following command to register the dll in the registry:
"C:\Windows\Microsoft.NET\Framework\v1.1.4322\RegAsm" coSecurity.dll /tlb:coSecurity.tlb
I don't know if it's worth mentioning but at one point the site worked perfectly in dev and erring when I attempted to move the site to production. I had moved the site to the new dev server (Windows 2008) so long ago. I had made notes so when I moved it up to production I knew what steps I had taken. I thought perhaps I forgot to record a step so in attempt to retrace what I did, I uninstalled the .dll and went through the steps I had recorded. It is now broken in dev but at one point it was working.
Another thing I'm not sure is worth mentioning is this site was the first site on the new dev server. .NET 1.1 was installed prior to any other framework. 4.0 and 2.0 were installed after the fact. On the prod server 4.0 was installed first and then 1.1. Not sure if that's signficant or not.
When the dev site was working I had confirmed the items were in the
registry comparing them to the old production and the new dev
servers and the new production
On the old production server there was nothing in the GAC
The coSecurity.dll is in the same file as the securityUtility.asp
(the page that the code belongs to).
The Application pool for the has "enable 32-bit applications" as true
for both of the new environments
"Everyone" is granted full rights on the .dll
I'm not sure what I'm missing!
This is what I ended up doing for those that have been beating their heads against the wall like I was:
opened a command prompt as administrator
navigated to where the dll was stored
unregistered the dll using
"C:\Windows\Microsoft.NET\Framework\v1.1.4322\RegAsm" /u
coSecurity.dll
re-registered the dll by using
"C:\Windows\Microsoft.NET\Framework\v1.1.4322\RegAsm" coSecurity.dll
/codebase
you'll get a regasm warning but should also get the message "Types
registered successfully"
After that I no longer recieved the error!
In general HRESULT 80070002 means "File Not Found".
My guess is you are missing a dependency. Try using Dependency Walker to see if there are any dependencies which should be included.
Also see this thread for some tips about registering COM servers manually.
Related
I have created a Windows Service using ASP.Net Core 3.x and C#. I started with the new Windows Service template when I built the project. When I run it from my development environment or from a console window it runs fine. When I install it as a Windows Service and attempt to start the service I get an
"Error 5: Access is denied." error.
I tried numerous things which I will outline below to eliminate the error but nothing seemed to work so I downloaded the sample app provided by Microsoft, at sample
Same result...when I run the sample app from within Visual Studio it runs fine, when running as a service I get the Access Denied error.
I am running all of this on my local machine, which I am an admin on.
I originally tried to run it using the default Local System account; got the Access Denied error.
I changed the Log On As to my domain account, the same one I use to log into my local machine which is an admin on this machine; got the same Access Denied error.
My account has the privilege set to run as a service.
The Event Viewer just shows the one message which says "Access Denied", no other messages are created.
I believe the Access Denied error is occurring before the C# code is even executed. What makes me believe this is that I added one line to the very top of the Program.Main.... File.WriteAllText("C:\\temp\\ws.log", $"Test of Worker Service # {DateTime.Now}. Content Root Path: {AppContext.BaseDirectory}");. My account has full access to the temp folder. This file gets created when I run the app from Visual Studio but it does not get created when I run the app as a service.
I have read numerous web sites, include this one and this one. No luck, everything I tried from these sites still produce the Access Denied error.
I have run out of ideas and am hoping someone here can provide me the answer. Thanks!
I found the solution and believe me I feel really stupid!!!
When I installed it as a service I only put the path in "binPath".
sc create WindowsService1 binPath="C:\temp".
Once I actually added the executable to the binPath parameter everything worked.
Changed it to sc create WindowsService1 binPath="C:\temp\WindowsService.exe" and it worked.
I know it is an Id10t error but Microsoft should really provide better messaging for the "sc" command. A message like "Cannot find file specified in the binPath parameter" would have been really helpful. Would have saved me about 6 hours of work.
Thanks everyone for reviewing and replying to this question.
I'm trying to implement Brother b-Pac printing library for label printing devices into my web application. I need to create/load the label template on server and print from the client's machine over a browser.
My code is totally working on my development environment. It only occurs on the published version. It's an access denied error thrown when the COM object got called by the app. I suspect there's an inner exception I couldn't reach.
The event got logged as follows:
Faulting application name: w3wp.exe, version: 8.5.9600.16384
Faulting module name: bpac.dll, version: 3.2.0.20
Exception code: 0xc0000005
Fault offset: 0x0010beea
Faulting application path: C:\Windows\SysWOW64\inetsrv\w3wp.exe
Faulting module path: C:\Program Files (x86)\Common Files\Brother\b-PAC\bpac.dll
I also used DebugDiag on the dump file and here's the report. Though it says here debugger couldn't locate debug symbols for bpac.dll, so it may be incomplete (If it may help, I'd like to know where and how to get symbols for a 3rd party DLL)
Application is a multilayer ASP.NET MVC app targeting the .NET Framework 4.6.1, running on a virtual machine with Windows Server 2012 R2 (x64) and IIS 8. (If it matters the project is derived from this template)
I searched about the issue and tried the following solutions:
Give read/write permissions of wwwroot and DLL's own folder to the IIS APPPOOL/user of the faulting w3wp.exe.
Give same permissions to IIS_IUSRS, NETWORK, NETWORK SERVICE users.
Impersonate Administrator user.
Uninstall/install 32bit/64bit versions of the b-Pac SDK.
Change bitness of my ASP app and all projects within to x86/x64.
Enable 32bit on the Application Pool.
Patch the Windows for July 2018 update issue
Setting Anonymous Authentication, App pool identity etc. all to the default pool user.
Loading the DLL dynamically. (not sure if I did this correctly though)
The COM object I'm trying to initialize is bpac.Document. Interface is IDocument and the concrete class is DocumentClass. I wasn't familiar with any of these concepts before. And I'm still struggling to understand but I tried all of these following lines for initialization:
Document label = new Document();
DocumentClass label = new DocumentClass(); //embed interop types: false
IDocument label = new Document();
After that, I'm using label object to open a template and etc. But as soon as the application hits any of the above lines it crashes the server and restarts the app.
Incidentally, the DLL file is referenced as a COM library in my WebService (App) project (not in the Web project). So it doesn't get copied on bin folder (I guess that's the correct behaviour?). Tried changing isolation/interop settings but I'm not sure if those are related to the issue at hand.
I read things about Registering COM objects into GAC and Marshalling for Remote Access but I couldn't grasp how to apply these properly. Thing is, the official documentation doesn't say anything about this. And there isn't a single example for using b-Pac library on a modern C# ASP.NET setting (only a little on VB ~eww~).
I'm a developer, not a DBA so I'm not too confident with tweaking the server's settings. But for this issue alone, I modified too many things too many times.
So, the problem was about the app id permissions all along. I changed the Application Pool's identity to LocalSystem and now it works as expected.
Still, I'm not sure what kind of security flaws this change would cause in the future. I posted this link to the vendor's technical staff. But they didn't give me an answer yet.
I am using 64bit Windows7 home premium SP1 and VS2015.
I wrote a WCF application which calls a 3rd party dll (from vendor) written in C#. When i "view in browser" by right clicking ProductREADService.svc in VS2015 solution explorer, I can call the svc(localhost:17476/ProductRESTService.svc) and method(this calls the 3rd party dll localhost:17476/ProductRESTService.svc/getproductlist/1) and the WCF works without any problem on the browser (chrome and IE), returning xml result correctly.
Now I want this WCF to running without VS2015 since I need it to run in production env.
Problem:
1)
However, when I publish this WCF to IIS7.5, I was able to call the svc (localhost:8123/ProductRESTService.svc) without problem, but when I called the method (localhost:8123/ProductRESTService.svc/getproductlist/1) I encountered request error "The server encountered an error processing the request. See server logs for more details."
When I checked the logs I found this:
2016-09-07 12:46:44 ::1 GET /favicon.ico - 8123 - ::1 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/52.0.2743.116+Safari/537.36 404 0 2 3
2016-09-07 12:48:26 ::1 GET /ProductRESTService.svc/getproductlist/1 - 8123 - ::1 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/52.0.2743.116+Safari/537.36 400 0 0 4
I tried changing the DefaultAppPool identity to LocalService and my windows login ID, nothing works.
In order to confirm the problem lies with the 3rd party DLL, I changed the method getproductlist not to load/call the 3rd party DLL but instead return fixed dummy value, and now both works perfectly. So I am sure the problem is caused by the DLL when running without VS2015.
2) I reverted back the code and stopped IIS and tried running IISExpress (using the IISexpress used by vs2015). I started it using the same config file as VS2015 inside /config:path-to-code.vs\config\applicationhost.config... I encountered the exactly same issue, while accessing localhost:17476/ProductRESTService.svc there is not problem.. BUT encountered error when accessing the method localhost:17476/ProductRESTService.svc/getproductlist/1.
Question:
q1) how come the WCF calling 3rd party DLL only works when launched using VS2015 and not when launched via IIS7.5 or IISexpress independently?
q2) how to copy the IISexpress settings/config from VS2015 into IIS7.5 and to the c:\program files\IIE Express\IISexpress.exe?
Any help will be appreciated. Thanks!
Update:
2) I found the problem for IISExpress.. I changed to "C:\Program Files (x86)\IIS Express\iisexpress.exe" instead of "C:\Program Files\" and both svc and method work! Why not "C:\Program Files" since my OS is 64bit?
I still cant get IIS to work for both, any help would be appreciated!
Thanks!
Update Solved!
I managed to fix the problem. In IIS 7.5.76 I set the DefaultAppPool advanced settings to
1) .NET Framework Version v4.0
2) Enable 32-bit application = true
3) Identity = LocalSystem
Now, my WCF service and method(calling 3rd party DLL) works with IIS and I can run it as a production service!
This question is related to my previous question.
I need to publish a C# application (that has been set up in IIS 6.0 and built in VS2010) to a desktop with win7.
I have set up IIS on my desktop well. Now I can install the application on my laptop by accessing the URL
http://myDesktopName.domain.com/MyApp
pointing to a physical location in desktop
e:\myPath\myApp\myAppService.svc
When I publish a new version of the web service, the application should get updated when I open it.
But, it gave me an error:
**the filename,directory name, or volume label syntax is incorrect**
After searching online, I found this error is normally caused by some unacccepted chars in the link. Here is the code that the msi (MS installer) needs to access and get the new version of the application.
System.Diagnostics.Process.Start("msiexec", "/favmuso \"" + myurl + "\"");
here,
myurl is http://myDesktopName.domain.com/MyApp/MyAppSetup.msi
Here, http://myDesktopName/MyApp/ is the virtual directory set in IIS 6.0 on my desktop. I can access and download it from IE in my laptop without any problems.
But, when the application notified me that a new version is available for updating the old one, I clicked the pop-up ballon on the application icon and then I got the error:
Error 123. The filename, directory name, or volume label syntax is incorrect.
If I try to access it from the C# code, I got the same error.
Then, I did a test by running
msiexec **/favmuso** http://myDesktopName.domain.com/MyApp/MyAppSetup.msi /Lv mapp_msi.log
In the log file, i found :
MSI (s) (80:DC) [18:04:33:089]: SECREPAIR: Failed to open the
file:http://myDesktopName.domain.com/mypath/\myAppSdetup (10).msi for computing its hash. Error:123
Error 123. The filename, directory name, or volume label syntax is incorrect.
Why my applcation setup file name was changed to
\myAppSdetup (10).msi
The "/favmuso" options can be found at
https://technet.microsoft.com/en-gb/library/cc759262%28v=ws.10%29.aspx#BKMK_Install
Any help would be appreciated.
thanks
So I noticed that you've asked this question elsewhere, and everyone was focused on the /favmuso piece of it.
I've been recently exeriencing this issue when trying to repair MSIs with a URL source when the original application was installed by SCCM 2012.
The workaround I found was to add a registry value at HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer. The value below causes the MSI to skip the problematic portion of the repair and move on.
Name: SecureRepairPolicy
Type: REG_DWORD
Value: 1
To be a bit safer, you look into setting the registry value to 2 and using a whitelist as described in this Microsoft article: https://support.microsoft.com/en-us/kb/2918614. (Ctrl+F "Steps to opt-out the affected programs".)
I have an application written in C#. This application is locking by windows, return something like: "The xxx application has stopped working".
Is it possible to get the reason for this crash? I tried using try{} catch{} throughout the application without success. It works on my computer, but not on my friend's computer.
Both computers have same configuration:
Windows seven 7 ultimate 32 bits
Processor:2.13ghz
memory ram: 2gb
UPDATE
Well, in the event log of computer of my friend I found some details of the crash:
Faulting application name: xxxx.exe, version: 1.0.0.0,time stamp:0x4eb5e63a
Fault Module Name:KERNELBASE.dll, version: 6.1.7600.16850, time stamp:0x4e21132b
Exception Code:0xe0434352
Identification of the process that failed: 0x26c
Start time of the faulting application: ...
Faulting application path: ... \xxx.exe
Path F module failures: C:\Windows\system32\KERNELBASE.dll
Report ID: xxxxx-yyyy-dddd-dddd-aaaaaa
UPDATE 2
Finally,I found the function that is causing the exception.
handling the function with try {} catch (Exception Err) {} I found some details of exception:
Err.Message:The device is not ready
Err.Source: mscorlib
how can I fix it?
"Works on my machine" is a very common problem with a myriad of causes. Generally the reason is that something is different between the two machines. Some easy things to rule out:
is your friend's computer a development machine, with Visual Studio installed?
does your application rely on a particular path (for example, a D: drive), a database, a service, a COM component, or something else that an install package should be including?
has your friend configured UAC differently from you? Does one of you sign on as the account Administrator, while the other uses another account that is in the Administrators group?
did you test a debug version on your friend's machine? debug versions usually aren't redistributable
did you test version x of the exe and version y of some class library, forgetting that you made a change to one of them yesterday?
do you and your friend have different versions of IE, Office, or some other component that may be used by the app? Do you have different IE settings (eg proxies?)
are the two computers both completely caught up on updates and service packs?
is the application trying to access some hardware (microphone, web cam) that is not on your friend's machine or is importantly different between the two machines?
The literal answer to your question is yes, you can sign up for something called Windows Error Reporting and get the reports that the dialog says it is collecting. However I sincerely doubt that you want them. You should have all the information you need to find the error right where you are. Concentrate on what is different (even if you think it's irrelevant) between the two machines.
Most likely it is a missing dependency. Double check to make sure that your program is installing all of the Dll's that it needs. I have run into similar problems usually with an .ocx file not being properly registered or not present.
As far as your question goes try using the MDbg.exe file from the .Net Framework SDK or Visual Studio. Microsoft also has other debugging tools available.