I am working on bitsadmin for downloading the files in the network.
I created process for running bitsadmin job creation, addjob, resume, etc.
Application works fine with windows 7 but when i run my exe on xp machine bits give exception as
BITSADMIN version 2.0 [ 6.6.2600.2180 ]
BITS administration utility.
(C) Copyright 2000-2004 Microsoft Corp.
Unable to get console input mode - 0x80070006
The handle is invalid.
but on xp machine when i create job using command prompt then it works.
What can be the problem???
I got the solution instead of using process for bitsadmin I used "SharpBITS.Base" to download the file.
Related
Summary:
My company uses TargetProcess (TP) to track progress on open projects and we've created a relatively small bit of code that imports updates to TargetProcess.
Currently upon build submission, we spin up a debian docker image, with Mono pre-installed, and it runs our small .NET(C#) program to connect our updates to TP.
Repro:
It appears TP recently updated their API to only accept TLS1.2 connections, so we had to create a new docker image with Mono 4.8, the Alpha channel, on it (per this article).
The program still doesn't work out of the box with this new Mono installation on a docker image so we took a few steps: (following the prompting from Mono's Security FAQ)
// Made sure that the most current version ca-certificates-mono is installed
// and it seems to have been installed upon installation of mono 4.8
apt-get install ca-certificates-mono
// This should be an unnecessary step from what I read, but ran anyway
cert-sync /etc/ssl/certs/ca-certificates.crt
// lastly btls-cert-sync command, but can't seem to get it to not return
// "command not found" no matter wher I try running it
btls-cert-sync
Testing:
There seems to be a really helpful thread on how to test if your certs are formatted correctly. After running this test command in my docker image, I'm still seeing the failure message below.
MONO_TLS_PROVIDER=btls csharp -e 'Console.WriteLine (new System.Net.WebClient ().DownloadString ("https://www.howsmyssl.com/").IndexOf ("1.2"))'
// error message
System.Net.WebException: Error: TrustFailure (Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED) ---> Mono.Btls.MonoBtlsException: Ssl error:1000007d:SSLroutines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED
Any help or advice to get our instance of mono to accept TLS1.2 connections would be awesome.
btls-cert-sync is a shell script for btls-cert-sync.exe
Find btls-cert-sync.exe, normally installed in 4.8.0/lib/mono/4.8 and run it with mono:
mono btls-cert-sync.exe
As of mono 4.8 beta 3, btls-cert-sync seems to have been merged into cert-sync.
Do make sure that you have an up-to-date version of cert-sync as it is possible to get old versions of cert-sync still installed even if you have updated mono because the ca-certificates-mono package has not been updated (Linux).
If you look at the cert-sync output you will see
Mono Certificate Store Sync - version 4.8.0.0
...
Importing into legacy system store:
...
Importing into BTLS system store:
...
A) I had set up:
A Windows server 2008 r2 (192.168.6.10) with domain (OFFICE) and a user "majid"
And 2 nodes : 192.168.6.164, 192.168.6.154 (all Win8 x64) joined on domain (OFFICE) with user "majid"
B) and also installed:
"HPC Pack 2008 R2 Client Utilities Redistributable Package with Service Pack 4" (HpcClient_x64.msi) on all three machines
"HPC Pack 2008 R2 MS-MPI Redistributable Package with Service Pack 4" (mpi_x64.exe) on all three machines
"HPC Pack 2008 R2 SDK with Service Pack 4" (sdk_x64.msi) on my developer machine (192.168.6.154) for building MPI enabled programs
And copied pingpong.exe (c++) and pingpong_.exe (C#) on location C:\MPI\ of all machines
C) and the way that I run pingpong.exe is:
running on all machines this command via CMD or PowerShell by Admin, and after that entering password for user "majid": (after that, smpd will pop up with blank screen, FINE!)
runas /user:OFFICE\majid "C:\Program Files\Microsoft HPC Pack 2008 R2\Bin\smpd.exe -d"
Running on my Developer machine this command via CMD or PowerShell by Admin , and after that entering password for user "majid": ( I want to run pingpong.exe in real cluster network)
runas /user:OFFICE\majid "cmd /K mpiexec -hosts 2 192.168.6.154 1 192.168.6.164 1 C:\mpi\pingpong.exe"
The result is GOOD! And my ping pong working!
*** PROBLEM:
pinpong.exe is a program that written in c++ (I think) so there is no problem and my cluster works!
I want to run pingpong_.exe that is written in C# with MPI.NET SDK , but after below set up it still won't work!
I have installed:
"MPI.NET Runtime.msi" on all machines!
"MPI.NET SDK.msi" on my developer machine (192.168.6.154)
reset the systems and ran all steps in (C) with pingpong_.exe
but result is blank screen! (my pinpong_.exe shows nothing!) if again i repeat steps with pingpong.exe it is working!
note: I also could run pingpong_.exe with "mpiexec -n 2 pingpong_.exe" on every machine, and it is working! that means it works with it self! but in network noooo!
note2: I disabled firewall on all machines!
please help me how to get pingpong_.exe (c# codded app) working in MS-MPI enabled Cluster ?
after that I want to write my own app with C# and run it in cluster for
University Project!
I couldn't simplified it more.
Thanks for Your Attention
updated: -----
I Got response from pingpong_.exe (c#) after 2+ minutes (about 135 seconds) so actually it is working but why 2 min lags????
Is it MPI.NET problem? or pingpong_.exe ?
note: pingpong_.exe is renamed pure app that i found in MPI.net samples located : "C:\Program Files (x86)\MPI.NET\pingpong.exe"
I am using Window 7 pro x64. I had istalled VS 2010 pro. After that, I uninstalled it and replaced with VS 2012 ulti. Now, I need the VS 2010 but i can't install it. I try to install both pro and ulti version from .iso file but i get the same error. The installer quit suddenly after a few second and the window log records two error:
-The first:
Faulting application name: setup.exe_Microsoft® Visual Studio® 2010, version: 10.0.30319.1, time stamp: 0x4ba20d29
Faulting module name: ntdll.dll, version: 6.1.7601.17514, time stamp: 0x4ce7ba58
Exception code: 0xc0000006
Fault offset: 0x0003dccf
Faulting process id: 0x1170
Faulting application start time: 0x01cf728abd52e628
Faulting application path: F:\setup\setup.exe
Faulting module path: C:\Windows\SysWOW64\ntdll.dll
Report Id: fb6a8ef5-de7d-11e3-ada9-70f39529732e
-And the second:
Windows cannot access the file F:\setup\sqmapi.dll for one of the following reasons: there is a problem with the network connection, the disk that the
file is stored on, or the storage drivers installed on this computer; or the disk is missing. Windows closed the program Suite Integration Toolkit
Executable because of this error.
Program: Suite Integration Toolkit Executable
File: F:\setup\sqmapi.dll
The error value is listed in the Additional Data section.
User Action
1. Open the file again. This situation might be a temporary problem that corrects itself when the program runs again.
2. If the file still cannot be accessed and
- It is on the network, your network administrator should verify that there is not a problem with the network and that the server can be
contacted.
- It is on a removable disk, for example, a floppy disk or CD-ROM, verify that the disk is fully inserted into the computer.
3. Check and repair the file system by running CHKDSK. To run CHKDSK, click Start, click Run, type CMD, and then click OK. At the command prompt,
type CHKDSK /F, and then press ENTER.
4. If the problem persists, restore the file from a backup copy.
5. Determine whether other files on the same disk can be opened. If not, the disk might be damaged. If it is a hard disk, contact your administrator or
computer hardware vendor for further assistance.
Additional Data
Error value: C0000023
Disk type: 5
I try to uninstall .Net 4.5 and install .Net 4.0 but it not help. I run the system file checker and hard drive checker but no error. Then i download the ntdll.dll and sqmapi.dll to replace these files in my computer but it also not help.
I think the .iso file still good because it still run in my friend computer.
So anyone suggest a solution ?
After i scan my computer with avira and delete some file buildlog in D drive(in my computer, C drive for OS and software, D drive for data), the installer work normally!
But i don't understand why some file buildlog in D drive can make VS can't install?
Background:
.NET Framework 2.0, C#
ESRI ArcGis 10.1
64-bit Windows Server 2008 R2.
We have a thirdparty program (System A for simplicity) using ESRI-components running a custom Model-system for Maps.
System A also uses it own licensing system.
We are pulling data from System A to the web for users to view.
The system as it follows:
Web <-> WebService (using .NET-Remoting 2.0) <-> WindowsService.exe <-> DataFetcherStub.dll <-> DataFetcher.dll <-> System A
Problem:
Running this on ArcGIS 9.3 up to ArcGIS 10.0 have been no problem and earlier version of System A.
The providers of System A currently upgraded this to ArcGIS 10.1, using .NET-interop from 10.0.
We did that also, but now it will not work using the .NET-Remoting -> WindowsService any more.
Running an EXE using the DataFetcherStub everything is ok.
Running the windows service it crashes within the System A.
Faulting application name: windows_service.exe, version: 1.0.4802.40962, time stamp: 0x51293874
Faulting module name: AfCore_libFNP.dll_unloaded, version: 0.0.0.0, time stamp: 0x4f920360
Exception code: 0xc0000005
Fault offset: 0x619fe9b0
Faulting process id: 0x14c0
Faulting application start time: 0x01ce120f632c1f0e
Faulting application path: D:\path\windows_service.exe
Faulting module path: AfCore_libFNP.dll
Report Id: a41b42dc-7e02-11e2-8e56-00155d0a11a9
Have anyone come up with this error when having licensing with ArcGIS and running through a windows service?
There is a thread on ESRI-forums, but it wont leave me any clues how to solve this?
http://forums.arcgis.com/threads/74546-Product-Licensing-in-Scheduled-Batch
Approaching the vendor is not an option as it took them nearly a year to fix the last problem we discovered. Pointing the finger at us for 9 months before they finally got the proof that it was their bug, and i am pretty sure they will fight this also. It is quicker if we can do a work-around.
I have tried doing this from the windows-service.
1) System.Threading.ThreadPool.QueueUserWorkItem(o => FireAndForgetProcess()); NO LUCK
2) Process.Start("FireAndForgetMe.exe") NO LUCK
Anyone can give another approach to get external exe to "release itself" from the windows service and act as if it started by it own?
The Esri development team gave me a fix without having to run using an admin account.
The issue here is that the FLEXnet Licensing Service (which Esri now uses at 10.1, but was not used in 10.0) doesn’t have the proper execution permissions set to it such that the “Network Service” account can start it.
Esri working on a patch, but in the meantime, there is a manual workaround:
Ensure that you are logged in as a user with administration privileges on the machine.
From the windows Start menu, select run and enter ‘cmd’. Right-click on “cmd.exe” and select “Run as Administrator.”
In the command prompt, run the following command:
sc sdshow "FLEXnet Licensing Service"
This will print out the DACL permissions that are registered with that service:
D:(D;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;NU)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;SY)(A;;CCLCSWRPLOCRRC;;;IU)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)
We need to insert “(A;;CCLCSWRPWPDTLOCRRC;;;WD)” into the permission string, such that it becomes:
D:(D;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;NU)(A;;CCLCSWRPWPDTLOCRRC;;;WD)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;SY)(A;;CCLCSWRPLOCRRC;;;IU)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)
NOTE: The user’s DACL string may vary, and edits to the string should be done carefully.
To register the DACL with the service run the command:
sc sdset "FLEXnet Licensing Service" ${your original DACL string with the new permission string inserted}
For the example above you would enter:
sc sdset "FLEXnet Licensing Service" D:(D;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;NU)(A;;CCLCSWRPWPDTLOCRRC;;;WD)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;SY)(A;;CCLCSWRPLOCRRC;;;IU)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)
You should see a [SC] SetServiceObjectSecurity SUCCESS. That's it. Network Service should now run without error.
Solution
I changed the account that are running the windows-service to my admin-account, and now it works. Either 10.1 demands more of the windows-account running the service, or they have downgraded the account.
I guess i have to check that in the morning. Problem solved however.
EDIT: It is the rights of the accounts that need to be raised after 10.1.
I have created a very simple window service using visual studio 2010 and .NُET 4.0.
This service has no functionality added from the default windows service project, other than an installer has been added.
If I run "installutil.exe appName.exe" on my dev box or other windows 2008 R2 machines in our domain the windows service installs without issue.
When I try to do this same thing on our customer site, it fails to install with the following error.
Microsoft (R) .NET Framework Installation utility Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Exception occurred while initializing the installation:
System.IO.FileLoadException: Could not load file or assembly 'file:///C:\TestService\WindowsService1.exe' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515).
This solution has only 1 project and no dependencies added.
I have tried it on multiple machines in our environment and two in our customers. The machines are all windows 2008 R2, both fresh installs. One machine has just .net 2.0 and .net 4.0. The other .net 2, 3, 3.5 and 4.
I am a local admin on each of the machines.
I have also tried the 64bit installer but get the following error, so I think the 32 bit one is the one to use.
System.BadImageFormatException
Any guidance would be appreciated. Thanks.
Another reason for this error might be that you copied your program from a source which windows considers untrusted.
You can unblock the assembly by clicking "unblock" after you right-click and select properties on the file.
Need to unblock files. or at least that's what fixed mine.
To do 'bulk' unblock in Powershell
get-childitem *.* | Unblock-File
or in DOS:
FOR %a in (*.*) do (echo.>%a:Zone.Identifier)
When we copy executable from another computer, Windows mark a flag on them for protection. Right Click on executable and in properties Click Unblock. It would clear flag and service executable would Install.
This issue came about for me because I was trying to install the service from a network location. By copying the service.exe to the local machine prior to using installutil, it fixed my problem and the service installed successfully.
don't forget to vote up...
Try the SC as follows:
1. open command line
2. write the below-
sc create ServiceName BinPath= "ExePath".
report on results...
I also faced the same issue. In my case I was deploying new version of utilities , i copied new exe , installog files and then trying to uninstall the utils.
I copied back the old version , uninstal the utils , copied the new version and installed it again. Anyway it is the logical sequence I should have followed in first place.
i have this issue and it for different between of .net version of util and my service
i use util for .net 2 and my service build with .net4
In my case this error was caused by accidentally passing the directory containing the service to InstallUtil instead of passing the service exe.
Obviously human error but I found the error message quite misleading.
you can use this command in developer command prompt run administrator
installutil C:\...\MyService\bin\Debug\MyService.exe
As per #doublehelix's response above, this answer put me on track for my particular issue which related to a service issue running in Windows XP (Unblock is not an option in the security tab that I could find). In my case I was attempting to run a service from a separate drive (i.e. not on the same drive as Windows and not under program files) although the actual physical disk was the same. Moving my service into the Program Files folder solved my underlying issue. (I intended to 'comment' against #doublehelix's answer but I don't seem to be able to in my current status).
Simply right click on your service files and select properties and then check the unblock checkbox
https://brianseekford.azurewebsites.net/2011/07/13/hresult-0x80131515-when-running-installutil-to-install-a-net-service/
Unblocking files did the job here. Weird thing is that the blocked files came from a signed installer run with admin privileges. Had to unblock several files in several folders at once.
I used the following registry tweaks to add context menus to a folder or file when Shift + right-click is pressed (it doesn't show up if just right-clicked).
Credits and references to the author in each code block.
Folder tweak:
Just save it as ShiftUnblockFolder.reg and import into Registry.
Windows Registry Editor Version 5.00
; Created by: Shawn Brink
; Created on: March 17th 2019
; Tutorial: https://www.tenforums.com/tutorials/129101-add-unblock-file-context-menu-windows-10-a.html
[HKCR\Directory\shell\unblock]
"MUIVerb"="Unblock"
"Extended"=""
"SubCommands"=""
[HKCR\Directory\shell\unblock\shell\001flyout]
"MUIVerb"="Unblock files only in this folder"
[HKCR\Directory\shell\unblock\shell\001flyout\command]
#="powershell.exe get-childitem -LiteralPath '%L' | Unblock-File"
[HKCR\Directory\shell\unblock\shell\002flyout]
"MUIVerb"="Unblock files in this folder and subfolders"
[HKCR\Directory\shell\unblock\shell\002flyout\command]
#="powershell.exe get-childitem -LiteralPath '%L' -recurse | Unblock-File"
Single file tweak:
ShiftUnblockFile.reg
Windows Registry Editor Version 5.00
; Created by: Shawn Brink
; Created on: March 17th 2019
; Tutorial: https://www.tenforums.com/tutorials/129101-add-unblock-file-context-menu-windows-10-a.html
[HKCR\*\shell\unblock]
"MUIVerb"="Unblock"
"Extended"=""
[HKCR\*\shell\unblock\command]
#="powershell.exe Unblock-File -LiteralPath '%L'"
[HKCR\Directory\shell\unblock]
"MUIVerb"="Unblock"
"Extended"=""
"SubCommands"=""
[HKCR\Directory\shell\unblock\shell\001flyout]
"MUIVerb"="Unblock files only in this folder"
[HKCR\Directory\shell\unblock\shell\001flyout\command]
#="powershell.exe get-childitem -LiteralPath '%L' | Unblock-File"
[HKCR\Directory\shell\unblock\shell\002flyout]
"MUIVerb"="Unblock files in this folder and subfolders"
[HKCR\Directory\shell\unblock\shell\002flyout\command]
#="powershell.exe get-childitem -LiteralPath '%L' -recurse | Unblock-File"
You can try to make a Setup Project for your service and run the MSI file on that server.