Exception thrown using VS publish on 1 developers machine - c#

When deploying 1 application through Visual Studio 2017 & 2015 one of our devs is getting the exception below raised in the servers event logs.
No other developer gets this exception, and it seems to happen for all apps that developer tries to deploy.
Here's what the log says about it on the server ...
The description for Event ID 1 from source Web Deploy 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:
User: S0000878\WROW
Client IP: 10.100.177.100:80
Content-Type: application/msdeploy
Version: 9.0.0.0
MSDeploy.VersionMin: 7.1.600.0
MSDeploy.VersionMax: 9.0.1972.0
MSDeploy.Method: Sync
MSDeploy.RequestId: 94589097-54ba-4753-a37b-32571bfe6b8f
MSDeploy.RequestCulture: en-GB
MSDeploy.RequestUICulture: en-GB
ServerVersion: 9.0.1962.0
Skip: objectName="^configProtectedData$"
Provider: auto, Path:
A tracing deployment agent exception occurred that was propagated to the client. Request ID '94589097-54ba-4753-a37b-32571bfe6b8f'. Request Timestamp: '16/05/2017 10:26:59'. Error Details:
System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
at System.IO.BinaryReader.FillBuffer(Int32 numBytes)
at System.IO.BinaryReader.ReadInt16()
at Microsoft.Web.Deployment.PackageDeserializer.GetNextEntryType()
at Microsoft.Web.Deployment.SerializationProvider..ctor(DeploymentBaseContext baseContext, PackageDeserializer deserializer)
at Microsoft.Web.Deployment.PackageDeserializer.GetSerializationProvider()
at Microsoft.Web.Deployment.DeploymentAgent.HandleSync(DeploymentAgentAsyncData asyncData, Nullable`1 passId, String user, String siteName)
at Microsoft.Web.Deployment.DeploymentAgent.HandleRequestWorker(DeploymentAgentAsyncData asyncData)
at Microsoft.Web.Deployment.DeploymentAgent.HandleRequest(DeploymentAgentAsyncData asyncData)
I'm at a loss because the deployment process works from all other dev machines and from our build boxes, and yet it's only the server that complains.
What should I be looking for on the developers machine that might help indicate the real problem here?

It seems that the problem was caused by proxy settings on the developers machine.
this sort of problem can be caused by tools like Fiddler (often used by developers to debug API calls to web services).
The developer seems to have fixed it by repairing VS in this instance suggesting that there was also an issue with the VS install.

In my case, the issue was caused by a security software in our environment. However, while doing research about this issue, I noticed that these are also required for Web Deploy to work:
Management Services should be installed (Add Role and Features > Web
Server)
Web Management Service sand Web Deploy Agent Service hould be
running
Make sure Fiddler or any other similar software is not
running while publishing
Make sure TCP port 8172 is open in the
server
Source: Web Deploy experienced a connection problem (ERROR_CONNECTION_TERMINATED)

Related

ClickOnce application is not installing with HTTPS URL

I am publishing my application with HTTPS setup url and host it to HTTPS url.
When I run setup.exe an error occurred.
An error occurred trying to download 'https://***.tjc.tv/WMSClient.application'.
See the setup log file located at 'C:\Users\mkumawat\AppData\Local\Temp\VSD3796.tmp\install.log' for more information.
Log file
The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [InstallMode] = HomeSite {string}
Property: [ProcessorArchitecture] = AMD64 {string}
Property: [VersionNT] = 6.2.0 {version}
Running checks for package 'Windows Installer 3.1', phase BuildList
The following properties have been set for package 'Windows Installer 3.1':
Running checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsi' and value '3.1': true
Result of checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe' is 'Bypass'
'Windows Installer 3.1' RunCheck result: No Install Needed
Launching Application.
URLDownloadToCacheFile failed with HRESULT '-2146697202'
Error: An error occurred trying to download 'https://***.tjc.tv/WMSClient.application'.
When I manually download this https://***.tjc.tv/WMSClient.application in browser then it's downloading and works fine but in setup.exe it's not working.
I have already tried following solutions but nothing works.
Enable - Launching applications and unsafe files in Custom level in Internet options.
Uncheck - Warn if changing between secure and not secure mode in advanced tab in Internet options.
Sign the ClickOnce Manifests in project properties in VS
But these all are failing nothing works.
This issue occurs with only HTTPS not HTTP. HTTP is working fine but I need to use HTTPS.
SSL certificate is valid.
Anyone know about this.
On our systems setup.exe failed as well, with the error URLDownloadToCacheFile failed with HRESULT '-2146697208', while, when clicking on the ourapp.application link or launching the downloaded file, the applicaction installed with no issue.
If we changed the install source from HTTPS to HTTP, we would then be able to install using setup.exe.
Our resolution was to re-enable the caching of HTTPS pages. Since setup.exe is using WinInet, this is an Internet Settings change that can be made thru IE.
In Internet Explorer, go to Tools/Internet options
Switch to the Advanced tab and scroll down to the Security section.
Un-check the item “Do not save encrypted pages to disk”.
Since most traffic is moving to HTTPS, this security feature doesn't make much sense to me anymore

Remote debugging throws strange exception

When remote debugging my UWP application, VS always throws the following error after deployment process starts:
Error: Exception has been thrown by the target of an invocation.
Remote machine is a Win10 VM. The application runs fine when I select "Local Machine" from target machines list.
Things that I have ensured:
VM and development machine can see each other.
Remote tools are installed on the VM and Remote debugger is running.
Remote debugger says "[UserX] connected" when I start deployment, so VS is talking to it.
I have tried all 3 modes of authentication (None, Windows, Universal) and neither works.
I have restored NuGet packages, rebuilt all projects in the solution etc.
I have tried "Debug instead of Launch" checkbox and "Uninstall and reinstall my package" options too.
Has anyone else seen this behavior?
(Exception has been thrown by the target of an invocation generally contains a more specific exception inside it that shows what actually went wrong, but in this case I do not have any way to dig into the main exception).
Here's a snapshot of Output window:
Edit
Some more information. The error changes to the following if I choose Universal authentication:
Error: Field not found: 'Microsoft.VisualStudio.ImmersiveProjectServices.BootstrapperOperationPackage.StandardCollectorCpuAgent'.

Event 100, System.ServiceModel.Activation 4.0.0

Over the last few weeks I've seen errors appearing in the windows logs quoting the following:
The description for Event ID 100 from source System.ServiceModel.Activation 4.0.0.0 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:
System.InvalidOperationException: Etw registration failed with error code e.
at System.Runtime.Diagnostics.DiagnosticsEventProvider..ctor(Guid providerGuid)
at System.Runtime.Diagnostics.EtwProvider..ctor(Guid id)
at System.Runtime.Diagnostics.DiagnosticTrace.CreateEtwProvider(Guid etwProviderId)
at System.Runtime.Diagnostics.DiagnosticTrace..ctor(String traceSourceName, Guid etwProviderId)
w3wp
1540
This is a windows server 2008, running sites under IIS and .NET 4
These errors are happening every 30 seconds or so now, and I have no idea where they are originating from.
All of the sites are running under the default ASP.NET v4.0 application pool.
Any one else had this error before?
I don't really want to do anything like a .NET repair unless I have to, as this is a live server and the sites on it are in use.
Thanks for any help.

MSBuild appending MSDEPLOYAGENTSERVICE to the end of my URL

I am trying to configure a build in TFS to deploy to our test box for continuous integration. The problem I'm having is that TFS wants to append the MSDEPLOYAGENTSERVICE to the end of my URL which is causing the deploy to return a socket error:
Retrying the sync because a socket error (10054) occurred. Retrying operation 'Serialization' on object sitemanifest (sourcePath).
Here are my MSBuild Arguments:
/p:DeployOnBuild=True
/p:DeployTarget=MSDeployPublish
/p:MsDeployServiceUrl=[ip address]:8172/MsDeploy.axd
/p:MSDeployPublishMethod=RemoteAgent
/p:CreatePackageOnPublish=True
The server is a Windows Server 2008 R2 64bit server with IIS 7.5. We have no problems using the publish feature of Visual Studio 2010 to deploy to the test box using the Url above. Any help would be much appreciated.
You don't need to specify MsDeploy.axd in your MsDeployServiceUrl. Also, I see you don't have a DeployIisAppPath value set. You should set it to the name of your website in IIS.
Below is an example from one of our CI builds.
/p:DeployOnBuild=True
/p:DeployTarget=MsDeployPublish
/p:CreatePackageOnPublish=True
/p:MSDeployPublishMethod=RemoteAgent
/p:MSDeployServiceUrl=http://[YOUR WEBSERVER URL]
/p:DeployIisAppPath="NAME-OF-WEBSITE-IN-IIS"
After a few days an tons of searching, I discovered the issue.
/p:DeployOnBuild=True
/p:DeployTarget=MSDeployPublish
/p:MsDeployServiceUrl=[ip address]/MsDeploy.axd
/p:MSDeployPublishMethod=WMSVC
/p:CreatePackageOnPublish=True
/p:DeployIisAppPath=[name of website in iis]
/p:AllowUntrustedCertificate=True
As it turns out, the publish method was the culprit. RemoteAgent cannot interpret the deploy correctly, which is why it fails to serialize. WMSVC is the appropriate setting for the publish method.

c# OPC Automation gives 80040154

I am a .Net developer. New to OPC. When I tried some samples of OPC Client all of them give this error. It seems the DLL is not registered it seems. But I don't know how and where to register this.
error: retrieving the COM class factory for component with CLSID failed due to the following error: 80040154
Even I tried this
regsvr32 Interop.OPCAutomation.dll",
but it also throws error like
The module "Interop.OPCAutomation.dll" was loaded but the entry-point DllRegisterServeer was not found.
Make sure that "Interop.OPCAutomation.dll" is a valid DLL or OCX file and then try again.
I have gone through so many existing forums. So many of them said to change the Platform Target to x86 and still I am having the same issue. FYI, I can see only see 'Active (Any CPU)' in the Platform option from the top of the Build tab of Project Properties.
Here are my environment details:
.Net 2005
OPCAutomation Weapper
Windows 7 64-bit OS
Dell Inspiron 1525 (I hope this is not a 64bit machine, but my engineer installed 64bit OS somehow).
Please help me.
Thanks in advance!
Just in case somebody is dealing with this problem (as I've recently been...) I get through it! After some time, I found out that it's something about the .NET framework running on 64-bit machines. As long as the.NET application works only with 32-bit CLR, we must set .NET framework to load CLR in WOW mode. To do so, type:
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64.exe SetWow
After this you should be able to run the applications.
You can go back and revert .NET Framework as it was before by typing:
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64.exe Set64
If the OPC Client Toolkit SDK (C++) is used, a problem with the remote registry service may cause this error as well.
On Windows 7, by default the Remote Registry service is set to manual and not started. Ensure that the Remote Registry service is started on all of the machines you want to deploy to. This can be done manually or using Group Policy.
The function GetCLSIDFromRemoteRegistry() uses the RemoteRegistryService in order to get the CLSID of an OPC Server. If this service is not started on the client machine, the OPC program may return the error 80040154.
The error you're getting is more than likely due to the OPC server not being properly registered. Make sure it is registered (usually by running it at the command line with a "/regserver" or "/service" parameter). There may also be security issues in which case you'd have to run 'dcomcnfg' (DCOM Config) to make sure the client has access to the server.
This question is a bit dated so I hope you figured it out by now, but I had the same exact issue and wanted to share my solution. In my case, I am using a Kepware server. If you compile and try to run a client application for this server using Interop.OPCAutomation on a machine that does not have the server installed, you will get a dll not registered error and "entry point not found" if you try to register the dll manually.
Solution: Make sure you've got the server installed and running.
Although this is an old post, I would like to share my solution.
My problem was that when I tried to install an application with the OPCAutomation.dll, it gave me 80040154 error because the class was not registered.
This is my solution, always with Administrator privileges:
Copy OPCDAAuto.dll into the "C:\Windows\System32" folder
On the cmd prompt type "C:\Windows\System32\regsvr32 opcdaauto.dll"
You should watch a message like this one:
image
Hope this helps!
The OPC dll only works in 32 Bits, my solution was to change the "Enable 32-Bit Applications" to True in the advanced settings of the relative app pool in IIS.

Categories