I am using ClickOnce for a C# Windows Forms application, and want to allow people to update the software by clicking an Update button, which will check the server online to see if there are any updates. I am using the following method (not exact, but same principle):
ApplicationDeployment ad = ApplicationDeployment.CurrentDeployment;
ad.CheckForUpdateProgressChanged += new DeploymentProgressChangedEventHandler(ad_CheckForUpdateProgressChanged);
ad.CheckForUpdateCompleted += new CheckForUpdateCompletedEventHandler(ad_CheckForUpdateCompleted);
ad.CheckForUpdateAsync();
This all works fine, the problem is trying to run this code from behind a proxy. A 407 error: Proxy Authentication required occurs. I can't find anywhere in the ApplicationDeployment class to enter proxy settings, even though ad.CheckForUpdateAsync() simply does a webrequest to the server (I assume). Any ideas?
Thanks!
Related
First of all, sorry for my poor english...
Let's see if I can summarize the problem, it is quite strange:
Before we start... I have 2 users inside my company's domain.
User1 --> Has a proxy configured
User2 --> NO proxy configured
You are only able to navigate if you have the company's proxy configured, otherwise it won't load any webpage
1 - I log on into my computer using User1 domain credentials
2 - First, I open Internet Explorer, and I can navegate to any webpage, everything works fine. (I keep the window opened)
3 - I have a C# aplication running on my computer, which connects to EWS and logs into the mailbox of User2. The code looks like this:
ExchangeService serviceInstance = null;
serviceInstance = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
serviceInstance.DateTimePrecision = DateTimePrecision.Milliseconds;
serviceInstance.Credentials = new WebCredentials(user, pass, domain);
serviceInstance.AutodiscoverUrl(mailbox);
After I connect to the mailbox, I loop the messages for different purposes, everything works fine, and I close the aplication.
4 - I open the same IE window from step 1 (I didn't close it) and I try to load any other page, for example, https://google.com the page doesn't load and it shows me a certificate error:
Certificate error
If I click on 'Continue to this website', a firewall error appears.
Firewall error
5 - If I close the IE window and open a new window, something, I don't know what, seems to restart, and I can navigate again to any webpage.
I have explained this problem with the Internet Explorer case, but that's just to make it more visual. I have another aplications on this computer which need to make http calls, connect to webservices... And they sometimes fail because of this.
Does anybody know what is happening? How can I solve this?
Any help is appreciated!
You could try defining the proxy in your code eg
// set up the proxy
WebProxy proxy = new WebProxy("valid-proxy", 8080);
proxy.Credentials = new
NetworkCredential("valid-user","valid-password","valid-domain");
service.WebProxy = proxy;
What I'm trying to do is to, from a Web Service (WCF), give a remote computer (the Web Service Consumer) the instruction to open its default Web Browser (be it Internet Explorer, Firefox, Chrome, etc.), navigate to a certain web page and keep monitoring the events of that browser so that I can capture a certain value from the Document Title at a certain point, and do stuff with it.
I'm already able to send the command to open Internet Explorer and navigate to a URL, from the Web Service to the remote computer (my consumer), but I don't like the approach since I can't monitor the Document.Title property for changes nor access its value at any given time. Here is an example:
using System.Diagnostics;
public void DoIt();
{
Process batchProcess = new Process();
batchProcess.StartInfo.FileName = "iexplore.exe";
batchProcess.StartInfo.Arguments = "http://whatever.com";
batchProcess.Start();
}
This opens up Internet Explorer on the remote machine and navigates to the Url I give it, but I can't keep watch for the Browser's Events or Properties Values....
Can somebody help? ;-)
I don't think you can access information in one application (the web browser) from another (the WCF client) like that, and it's certainly not possible to do it without knowing what the user's default browser is.
You might have more luck using a WebBrowser control (WPF or Windows Forms), which embeds Internet Explorer's engine into the application and allows you access to the document title.
I have been struggling with this since 1 month. Can someone please help me with this scenario?
I have QTP installed on one server and my ASP.Net web application installed on a different server. I am trying to invoke QTP from my web server using C# or VBS code. Both approaches are not working. After doing a lots of research i came to know that i will need to add the user that is trying to invoke QTP to COM settings on QTP server. I even added my self to the COM settings but this approach is not working as well. After doing some research i came to know there might be a problem with permissions or firewall restrictions. But i have reached out to our network team and came to know that there are no firewall restrictions between our servers. Below are the C# and VBS approaches i used and there outcomes. Please help me with this request if anyone knows the solution for this issue. Thanks in advance.
VBS approach:
.cs file code
System.Diagnostics.Process.Start(#"C:\Program Filestest1.vbs");
.vbs file code
Dim qtApp
Dim qtTest
Dim qtResultsOpt
Set qtApp = CreateObject("QuickTest.Application","Server IP")
qtApp.Launch
qtApp.Visible = True
Outcome:
Code ran On Server : No error message and it dint invoke QTP on the other server.
Code ran from local : Error message Permission denied: 'CreateObject' , 800A0046.
C# code approach:
Type remoteQTP = Type.GetTypeFromProgID("QuickTest.Application", "Server IP");
QuickTest.Application qtp = (QuickTest.Application)Activator.CreateInstance(remoteQTP);
qtp.Launch();
qtp.Visible = true;
Outcome:
Retrieving the COM class factory for remote component with CLSID {2B9B8E92-EBAA-44AF-A23C-9FBD08EAFA54} from machine Server IP address failed due to the following error: 80070005.
Can you check whether you have permissions specific to the QTP Remote Agent COM service on your target machine. Here are the steps:
Go to Control Panel>Administrative Tools>Component Services.
In the Component Services snap-in, navigate to Computers\My
Computer\DCOM Config.
In the right pane, locate AQTRmtAgent.
Right- click the AQTRmtAgent and then select Properties.
On the Security tab, select Customize, and then click Edit.
Add the user to the permissions list.
PS: Sorry I just re-read your question and you mention you have tried adding the user to COM settings but it does not specify which process you tried to add, So I'll keep my post and try to help based on your response.
I have an ASP.NET MVC 3 application which uses PowerShell to connect to Office 365 to retrieve some details about user licenses.
The code itself works in many cases:
The project in my local IIS works
A piece of code in LINQPad using the library works on my machine
A piece of code in LINQPad using the library works on the target server
And where it doesn't work is of course the only place it really should work: The IIS on the target server.
I always get an Exception when calling the Connect-MsolService cmdlet. The problem is that the Exception doesn't tell me anything.
The Exception type is
Microsoft.Online.Administration.Automation.MicrosoftOnlineException
and the message is
Exception of type 'Microsoft.Online.Administration.Automation.MicrosoftOnlineException' was thrown
which is pretty useless.
The Office 365 user account I use in my code is always the same. The user account used to start the IIS is always the same, too (Local System).
I wrapped the PowerShell code execution in a class named PowerShellInvoker. Its code can be found here.
And here is the code that connects to Office 365:
var cred = new PSCredential(upn, password);
_psi = new PowerShellInvoker("MSOnline");
_psi.ExecuteCommand("Connect-MsolService", new { Credential = cred });
There is no Exception actually thrown, the error is found in the Error property of the pipeline. (See lines 50ff. of the PowerShellInvoker class.)
The problem is that I don't know what could be wrong, especially because the same code works when I use LINQPad. The search results by Google couldn't help me either.
The server runs on Windows Server 2008 R2 Datacenter SP1 with IIS 7.5.
I found the solution!
I don't know the reason, but on the target server, the app pool's advanced settings for my app had set Load User Profile to False. I changed it back to True (which should be default) and voilĂ , it works!
Edit: The Load User Profile setting was apparently automatically set to False by default because the IIS 6.0 Manager was installed and False was the default behavior until IIS 6.0.
I am working on integrating my company's product with Jira so users can log bug reports directly from the application. Everything was wqorking smoothly so i decided to import the data from our live Jira system into my development system so that i had some real world data to play with. Since then when i try to get an authtication token it throws the following exception "com.atlassian.crowd.exception.PasswordEncoderNotFoundException: The PasswordEncoder 'atlassian-security' was not found in the Internal Encoders list by the PasswordEncoderFactory". I have checked and the Atlassian Security Password Encoder is enabled in the Crown Password Encoders plugin.
My code is super simple just an ASP.net based text based issues search with the results wired to a grid view code as below:
JiraSoapServiceService service = new JiraSoapServiceService();
string token = service.login("integration", "test");
if (!string.IsNullOrEmpty(txtSearch.Text))
{
RemoteIssue[] issues = service.getIssuesFromTextSearchWithLimit(token, txtSearch.Text, 0, 100);
gvwIssues.DataSource = issues;
gvwIssues.DataBind();
}
I get the error on the call to service.login, it worked fine before I imported the live data. And yes i did add the integration user again after i had imported the data.
Anyone any ideas on this.
No idea what was causing this but rebooting the PC that the dev Jira was installed on fixed it.
EDIT
I have had this a few times now. It tends to happen when you do something like restart the SQL server, restore the jira database via SQL server, restore jira via the inbuilt XML file import method or similar. You don't have to restart the machine just the jira windows service. No idea if this is a problem with other DBs or server types.