Problems connecting to data folder using sage sdo18.(ForwardCallToInvokeMember) - c#

I'm developing an automatic invoicing system using c#.net v4.0 and Sage's SDO. The Application works fine on my local machine both in a development environment and on iis 7. I am now trying to implement it on a live server and I am getting the following error:
SAGE EXCEPTION:Not connected to Data Source - Connect or Logon failed .
Error Code:sdoNotConnected
StackTrace: at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData) at SageDataObject180.IWorkSpace.CreateObject(String Name) at RestrictedPages_ViewReport.GenerateInvoice(Object sender, EventArgs e) in c:\inetpub\wwwroot\IE Support Manager Integration\RestrictedPages\ViewReport.aspx.cs:line 386
The iis7 process is running on a 32 bit process. The folder is hosted on a machine on the network but not on the machine that the web application is installed on. I can read and write to this folder from the web application so I doubt its a permissions problem.
I've been tearing my hair out with this problem for 2 days now so any help would be much appreciated!!

Can you post the actual code where the error is happening? I am guessing its permissions or a variable that needs changing.

Related

System.Reflection.AmbiguousMatchException on MongoDb.Driver

all.
I created Rest API with ASP.NET 4 and Mongo. It works fine in my local PC under Windows 10, also it works fine in test environment under Windows 2008 R2 + .NET 4.7.1. But it doesn't work on my prod environment under Windows 2012 R2 + .NET 4.7.1, I got the following error:
System.Reflection.AmbiguousMatchException: Multiple custom attributes of the same type found.
at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit)
at System.Runtime.InteropServices.RuntimeInformation.get_FrameworkDescription()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at MongoDB.Driver.Core.Connections.ClientDocumentHelper.CreateClientDocument(String applicationName)
at MongoDB.Driver.Core.Connections.BinaryConnectionFactory..ctor(ConnectionSettings settings, IStreamFactory streamFactory, IEventSubscriber eventSubscriber)
at MongoDB.Driver.Core.Configuration.ClusterBuilder.BuildCluster()
at MongoDB.Driver.ClusterRegistry.CreateCluster(ClusterKey clusterKey)
at MongoDB.Driver.ClusterRegistry.GetOrCreateCluster(ClusterKey clusterKey)
at MongoDB.Driver.MongoClient..ctor(MongoClientSettings settings)
at Treolan.Catalog.Providers.BaseDataProvider..ctor(IAppSettings appSettings) in D:\Projects\TreolanCatalog\Treolan\Treolan.Catalog.Providers\BaseDataProvider.cs:line 39
at Treolan.Catalog.Providers.Categories.CategoriesProvider..ctor(IAppSettings appSettings) in D:\Projects\TreolanCatalog\Treolan\Treolan.Catalog.Providers\Categories\CategoriesProvider.cs:line 22
at Treolan.Catalog.WebApi.Controllers.CategoriesController.<>c.<.ctor>b__6_0() in D:\Projects\TreolanCatalog\Treolan\Treolan.Catalog.WebApi2\Controllers\CategoriesController.cs:line 31
at Treolan.Catalog.WebApi.Controllers.CategoriesController.<Get>d__7.MoveNext() in D:\Projects\TreolanCatalog\Treolan\Treolan.Catalog.WebApi2\Controllers\CategoriesController.cs:line 48
I found the similar issue, but other developers used Application Insight on Azure. I don't use Application Insight or Azure.
I tried to use MongoDb.Driver 2.5.0 and 2.6.1 but I got the same issue.
Could you help me?
I had this issue and after searching I have found a solution for me
My app is in an Azure VM
To solve this
Go to this machine using Terminal Server,
go to Control Panel,
go to programs/features
remove the application insights status monitor toolkit from server
This have resolved the issue for me
Hope it helps

Windows service access to UNC path

I have a windows service written in C# running on Windows Server 2012. The service is running as a domain user with permissions on the local machine and NTFS permissions to shared network resources
can access shared files and directories in Windows Explorer when logged on as this user
I reboot the server, the file system calls succeed at first. Then after some amount of time, or after accesses to the same file path from that computer, the programmatic calls will start to fail and will never spontaneously succeed again. Rebooting the server fixes the issue for a very short while.
I referred
Windows service cannot access UNC path
I am facing the same issue as in the above link. But the network share is between Windows server 2012 R2 and another server with same OS.
Exception stack trace :
MESSAGE:
An unexpected network error occurred.
STACK TRACE:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileSystemEnumerableIterator1.MoveNext()
at System.Linq.Enumerable.Any[TSource](IEnumerable1 source)
Can anypne please help?

oracle empty exception oracle dataaccess

I am under pressure on this one so any help would be great. This seems a long question buts its not.. I have just included as much info as possible.. rgds M
I have an Web Application with a Webservice installed on 3 environments (Dev, UAT and Prod) The system calls the web service from an SSIS package on SQL 2008 and it hits the method no Problem on the web service on all environments. I then try and open an oracle connection within the method like in the simple code below using the Oracle Assembly : Oracle.DataAccess.Client;
Hers is Sample Code :
// Create and open a connection.
OracleConnection mConnection = new OracleConnection(sCnx);
mConnection.Open(); -- Fails at this call.
The Exception Message and number are blank as per this similar issue - Oracle.DataAccess.Client.OracleException at Connection.Open()
However I have checked the Pass through setting and its set to true on all environments.
This is my connection string
<add name="cnx" connectionString="DATA SOURCE=MYHUP1.US.COM;PASSWORD=456336;PERSIST SECURITY INFO=True;USER ID=MYAPPUSER" providerName="Oracle.DataAccess.Client"/>
This is the version of the DLL that I use below. All Dlls are built and deployed with my application and in a bin folder. I have also checked that the Oracle.DataAccess.dll gets loaded from the BIN folder and not the GAC or from the Oracle 11 (64 Bit) install on the server.
Oracle.DataAccess.dll
Version 2.112.3.0
32 Bit
These are also included in the bin oci.dll, ociw32.dll, orannzsbb11.dll, oraocci11.dll, OraOps11w.dll
My application runs on a 64 bit machine but is a 32 bit app and I have this set on the App pool. Again it runs fine On DEV but not Prod. It also runs under the same service account on all 3 environments.
The thing that hammers me is the error message is blank and I have had to put loads of code in to check loaded modules and the groups that the service is running under. These all look fine.
Error Message from the Exception: Note the Message is blank.. this is the info when that I get when I pump everything out
Oracle.DataAccess.Client.OracleException at
Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32
errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx*
pOpoSqlValCtx, Object src, String procedure, Boolean bCheck) at
Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode,
OracleConnection conn, IntPtr opsErrCtx, Object src) at
Oracle.DataAccess.Client.OracleConnection.Open() at
XXX.Business.XXXBO.TestConnectionAndDeleteData(Nullable`1 updateDate,
Int64 currentUserID) in C:\Development\XXX........
On my Dev and Prod Environment I have the following Version of Oracle installed but I am using my own Drivers in the Bin Directory as mentioned above so I didn't think this would matter..
DEV = Oracle Provider version 11.2.0.1.0
PROD = Oracle Provider Version 11.1.0.6.20
Would anyone have any ideas as to why this wont work on my Prod Environment. I have been over IIS with a fine comb and compared to the other environments and they are the same. Just trying to track this down to an IIS issue, or Oracle. Please note that I don't have access myself to the UAT environment which also does help!!
best regards Mick
this is what you will need to do to correct it .
Install the 32bit client along side the 64bit one.. The 64bit version does not work in regards to using standard connection string.. not sure how Oracle can let this bug go on for so long without fixing it.. installing side by side is what we did.. it will install into it's own folder so you should have no issues.. when you consume the .dll just set the copy to local = true and remove the old and re add the new .dll.. make sure you use navigate to the 4.x folder not the 2.x folder.

Using C# to administer IIS

I would like to create an app that will deploy a website. Basically, I just want this app to copy the publish files to the webserver in a new folder, change the website to that folder, then recycle the app pool.
I found out that I should be able to do this with Microsoft.Web.Administration. I am having a problem with even the most basic task as I'm learning how to do this. here is my code in a windows form app to just play with this.
try
{
using (Microsoft.Web.Administration.ServerManager sm = Microsoft.Web.Administration.ServerManager.OpenRemote("webservername"))
{
foreach (var site in sm.Sites)
{
MessageBox.Show(string.Format("{0}", site.Name));
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
I'm simply trying to loop through the websites and display the names as my first try. The error I get is the following:
System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Web.Administration.Interop.IAppHostWritableAdminManager'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{FA7660F6-7B3F-4237-A8BF-ED0AD0DCBBD9}' failed due to the following error: Interface not registered (Exception from HRESULT: 0x80040155).
at Microsoft.Web.Administration.ConfigurationManager.CreateAdminManager[TClass,TInterface](WebConfigurationMap webConfigMap, Boolean isAdminConfig)
at Microsoft.Web.Administration.ConfigurationManager.CreateWritableAdminManager(WebConfigurationMap webConfigMap, String configPathToEdit, Boolean isAdminConfig)
at Microsoft.Web.Administration.ConfigurationManager.CreateConfiguration(WebConfigurationMap configMap, String configPathToEdit, Boolean isAdminConfig)
at Microsoft.Web.Administration.ConfigurationManager.GetConfiguration(String rawConfigurationPath, String cacheKey, Boolean isAdminConfig)
at Microsoft.Web.Administration.ConfigurationManager.GetApplicationHostConfiguration()
at Microsoft.Web.Administration.ServerManager.GetApplicationHostConfiguration()
at Microsoft.Web.Administration.ServerManager.get_SitesSection()
at Microsoft.Web.Administration.ServerManager.get_Sites()
The line that errored is:
foreach (var site in sm.Sites)
I've tried this with both my local IIS8 express and a windows server 2008 IIS 7.5
What have I done wrong?
You may want to check the following points:
The Name of the server. If not sure try looking for in your IIS Management
The version of the .dll is the right for your version of IIS.
The .net framework version. Since it use System.Web it depends on full-version of the .net framework but not on the Client Profile subset.
The machine on which the code is executing needs to have the IIS Management Scripts and Tools Windows feature installed.
On a Windows client OS or on Windows Server 2008 R2 and earlier, you can install it via the following steps:
Open Control Panel > Programs > Turn Windows features on or off.
Drill down to Internet Information Services > Web Management Tools and check IIS Management Scripts and Tools.
You are trying to manage a remote server, so
The account runs the code must be the local administrator of that remote server.
The DCOM ports must be opened at firewall.

Remote execution of CodedUI tests on Virtual machine by Test Controller and Agent

I would like to ask some help regarding the case below.
The goal I would like to achieve is having a Virtual Machine Windows 7 SP1 running on it and having that my colleagues - developers - can run the CodedUI tests run on this machine. In order to that I created the VM on my machine, it is available for everybody. I installed a VS 2013 Test Agent and Controller from here: http://www.microsoft.com/en-us/download/details.aspx?id=40750
I set up both and according to the information they can communicate to each other.
I set up a user for running the tests. This user is member of Administrator and other groups which is described in the MSDN pages. When I start the VM it logs in automatically and I got the same you can see the screenshot below:
Furthermore, when I want to set up the agent in VS 2013 it says that it - VS 2013 - can communicate to the Agent placed on the virtual machine. I can see the Agent and Controller properties in VS. However, it strange for me that, the agent name is displayed like this: *agent_name. I mean asterisk and after the agent name.
After I select the testsettings file in the test settings menu and I say to the VS that please run this test on VS it builds and working on it at least 1-2 minutes and it says "Test skipped". It does not matter whether the test is single unit test or mix of SpecFlow/CodedUI. It fails always.
I found interest things in the eventlog's of that machine where my VS runs. The VM's, where the Agent and the Controller run, are empty.
The description for Event ID 0 from source VSTTExecution cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
(vstest.executionengine.x86.exe, PID 8440, Thread 10) ControllerProxy: Queue test run error: System.Net.Sockets.SocketException (0x80004005): No such host is known
Server stack trace:
at System.Net.Dns.GetAddrInfo(String name)
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()
at System.Runtime.Remoting.Channels.RemoteConnection.GetSocket()
at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortAndSid, Boolean openNew)
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.VisualStudio.TestTools.Common.FileCopyService.get_DeploymentFlags()
at Microsoft.VisualStudio.TestTools.Controller.ControllerExecution.<StartTestRun>b__1e(FileCopyService fileCopyService)
at Microsoft.VisualStudio.TestTools.Execution.RemoteObjectContainer`1.InvokeAsRemoteUser(Action`1 invoke)
at Microsoft.VisualStudio.TestTools.Controller.ControllerExecution.StartTestRun(TestRun testRun, RemoteObjectContainer`1 fileCopyServiceContainer, RemoteObjectContainer`1 defaultListenerContainer)
at Microsoft.VisualStudio.TestTools.Controller.ControllerObject.QueueTestRun(TestRun testRun, FileCopyService fileCopyService, IControllerEvents eventHandler)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [1]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.VisualStudio.TestTools.Controller.IControllerExecution.QueueTestRun(TestRun testRun, FileCopyService fileCopyService, IControllerEvents eventHandler)
at Microsoft.VisualStudio.TestTools.TestManagement.ControllerProxy.QueueTestRunWorker(Object state)
the message resource is present but the message is not found in the string/message table
If VS and the controller can communicate each other then why I got the "no such host" error?
I went through a lot of descriptions and error reports here and at Microsoft, but I don't know what to do. I've double-checked the settings many times and everything is ok.
Anybody, any idea what can I do?
Since I had this problem I collected some experience in this topic. However, I feel that these products of Microsoft are very immature.
What I could achieve is that, I set up the virtual machine I mentioned and I'm able to run CudedUI tests on it executed by Test Manager. In order to have this I had to set up a test agent, which driven by a test controller placed in the company's infrastructure somewhere, on the virtual machine by Test Manager. In this case #Eli El-Tawil you were right and thanks for the suggestion.
However, if I want to run CodedUI tests on this machine, which has the test agent installed, from Visual Studio I could not, because Visual Studio cannot connect a test controller registered for test manager infrastructure, or the controller does not allows connection. I don't understand the point of it.
Here are some things I have run into for anyone looking for this in the future.
Running tests through Visual studio. Install Controller and agent manually. When setting up the controller DO NOT register with team collection. When setting up agent set name of controller server including :6901. The system should add the test user to the system automatically. If you are running on a domain you will probably need to add the VM to the domain.
Running tests through MTM. Use MTM to install agents and controllers on machine. Only run tests from MTM as they cannot be run from VS.
If you want to run tests using visual studio and MTM you will want to setup two VM's one with each setup.
Notes for running tests with Visual Studio Remotely.
Start a remote connection to the server that will be running the tests (a remote connection must be open to run tests). There are workarounds if you use hyper-v. The connection can be hidden behind apps, but cannot be minimized.
Due to something on our domain setup I cannot run remote tests unless I run connected to the VPN, working with helpdesk to resolve this issue now. Try this if you have connection issues.
The settings to disable the screensaver on agent install do not seem to work, at least it did not work for me on 9 different VMs. I had to edit that and auto login through the registry.
You can run tests using vstest.console.exe remotely without using visual studio or MTM, I prefer to run a remote powershell script, but you can use a test setting file as well. https://msdn.microsoft.com/en-us/library/jj155796(v=vs.110).aspx Use the same controller and agent setup as if you would be running from Visual Studio.
If the controller is on a different domain make sure to use the fully qualified domain name, ie myserver.companyname.corp

Categories

Resources