I have a abp.io backend version 7.0.0 RC and angular frontend, and my remote or backend UserFriendly exceptions are not showing in my angular application when deployed to Azure, but local they working fine.
below its how l'm showing my exceptions
throw new UserFriendlyException("exception message")
Going throught the documents this is what i have tried and still they are not showing
Configure<AbpExceptionHandlingOptions>(options =>
{
options.SendExceptionsDetailsToClients = true;
options.SendStackTraceToClients = false;
});
I have added the above to my ApplicationModule and Domain Module
it seems the issue is not related to code it might be firewall/security policy related to the enviroment you can open developer tool on browser and check the network tab to further invistigate
Related
I have a project which front end is angular backend is .net core web api and i am using Cordova to convert this project to APK. But i have a big problem. My GET request works well on browser (which i used 'cordova run browser' command) but when i try get request on mobile, nothing happens. I am assuming that my backend works on localhost. My browser can access local host but my Android Studio Emulator phone can't access localhost. How can i fix that? Please help me thank you!
This is my code piece where i try to get request.
ngOnInit() {
document.addEventListener("deviceready", this.onDeviceReady, false);
this.onBrowserReady(); // TEST BROWSER
}
onDeviceReady() {
alert(1)
cordova.getAppVersion.getVersionCode(function(version) {
alert(2)
this.versionService.GetNewVersion().subscribe(x => {
alert(3);
this.object2 = new Object();
this.object2 = x;
});
});
}
In a new project as frontend developer the team I joined is using ASP.NET MVC for the backend. I am running a mac, so this means I can only compile the C# sources on Windows to run the application locally.
I have a Win10 setup inside a VM using virtual box. The sources are on the host and shared to the guest via a samba share (On Z:\ in the guest) and a host-only network adapter. Goal is to reach the app then from the host using the IP of the Guest, i.e. https://192.168.56.102:44301/ (it`s a single page application written in angular)
In the guest I compile from the command line using msbuild and then I start the REST API and the "Web App" using iisexpress.exe: (because visual studio is way to slow in the guest)
commands to build & start:
msbuild Z:\TheApp.sln
:: shell #1
iisexpress.exe" /config:Z:\.vs\config\applicationhost.config /site:"AppName.Api"
:: shell #2
iisexpress.exe" /config:Z:\.vs\config\applicationhost.config /site:"AppName.Web"
In Web.config of the Solution AppName.Web I have the following option:
<add key="ApiEndpointBase" value="https://192.168.56.102:44302/" />
The REST API is listening on port 44302, the "web app" on port 44301
So when I enter https://192.168.56.102:44301/ I get the app served.
The problem:
For each page reload the web app (HomeController.cs) does an http request against the API, so this means it is internally communicating to https://192.168.56.102:44302/
// HomeController.cs
// this fails with an exception like "An error occurred while processing your request.":
private readonly HttpClient client = new HttpClient();
...
/// <returns>The index view.</returns>
public async Task<ActionResult> Index() {
var response = await clientclient.GetAsync("api/foo?someId=" + someId);
client.BaseAddress is https://192.168.56.102:44302/
So there are two apps running in the guest using iisexpress, and one of them does an http request against the other using the Address https://192.168.56.102:44302/.... - and this request times out, or fails somehow and I don't get why.
It works if:
<add key="ApiEndpointBase" value="https://localhost:44302/" />
I visit https://localhost:44301/ in a browser inside the guest
But I want to access it from a browser on the host. Would really appreciate if some asp.net devs may help me here :)
EDIT:
External requests are already working. Else I would not get the app served on the host. I also registered the URLs using netsh and windows firewall is disabled on the guest. So I think this is not a duplicate of IIS Express enable external request
I have a custom web service, which is used to execute a workflow in Sharepoint 2013. Here is part of the code, which works pretty well when I run the web service in VS.
WorkflowSubscription workflowSubscription =
workflowManager.GetWorkflowSubscriptionService().GetSubscription(new
Guid(Properties.Settings.Default.SPWorkflowId));
Dictionary<string, object> payload = new Dictionary<string, object>();
payload.Add("approvers", assignedTopo);
payload.Add("approversbn", assignedTo);
payload.Add("approversgd", assignedTogd);
worfklowService.StartWorkflowOnListItem(workflowSubscription,
Convert.ToInt32(currentFileInSP.ListItemAllFields["ID"]), payload);
context.ExecuteQuery();
enter code here
After publishing the web service to IIS the workflow started to show error messages. In English something like this "The operation is prohibited, because it exceeds the threshold value of the list view, set by admin". The exact message in Russian is "Операция, попытка выполнить которую осуществляется, запрещена, поскольку она превышает пороговое значение представления списка, принудительно установленное администратором." How can IIS influence SharePoint like this? Could the problem be related to encoding? Here is the screenshot of error message:
By the way, in the same web service I upload file to SharePoint. This part of code is working fine even in IIS.
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.