How to configure a custom error page in SSRS 2019 - reporting-services

I created a custom error page that I would like report users to see when there are errors.
I modified the web.config file and restarted the SSRS service, but this just caused the reports not to load.
Is it possible to have a custom page displayed?
If so, what file location should be used to house the custom error page?
<configuration>
<system.web>
<customerrors mode="RemoteOnly" defaultRedirect="CustomErrorPage.html" />
</system.web>
</configuration>

Related

PageSpeed Insigths and GoDaddy Windows Hosting

I'm having an issue with cache in my webpage.
My webpage is hosted by GoDaddy, with the Economic Windows Server with Plesk.
conexaomktdigital.com.br
It's a very simple site, I DONT USE PHP on it, only HTML, CSS and simple bootstrap JS.
When I run PageSpeed Insights, the results are telling me to optimize browser cache, including adding expire dates to my .css and images.
Mobile: 60/100
Desktop: 75/100
HOW I DO IT? I seek everywhere and don't see anything, everybody talks about .htaccess, but it's not apache, it's windows with plesk by GoDaddy... What should I do, can someone help me?
Create and use a correct 'Web.Config' file. put it in your root folder.
You can find some information about how to use a web.config file with te right tags here:
https://www.giftofspeed.com/leverage-browser-caching/
I use a very simple configuration, it appears to work nice for me:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true"/>
<caching enabled="true" enableKernelCache="true">
<profiles>
<add extension=".html" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange"/>
<add extension=".css" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange"/>
<add extension=".js" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange"/>
<add extension=".jpg" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange"/>
<add extension=".png" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange"/>
</profiles>
</caching>
</system.webServer>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true"/>
</system.web>
</configuration>
this will keep the files listed there in cache until it have some change.
No Error 500 for me, I think it will not happen to you too.

Redirect using web.config file when there is no pathname

I've been working on a ASP.NET web application project in Visual Studio. In that project, when the user enters the hostname they get a 404 error but what I would like to happen is for them to be redirected to the index.html when they have just entered the hostname.
Below is the code that I tried using but it didn't work. It said there were too many redirects which I think has something to do with the path value being empty
<location path="">
<system.webServer>
<httpRedirect enabled="true" destination="index.html" httpResponseStatus="Permanent" />
</system.webServer>
</location>
Does anyone have an suggestions?
If you are using MVC you could create a default route but since you asked for a way to do it in web.config try:
<configuration>
<system.web>
<customErrors defaultRedirect="index.html" mode="On">
<error statusCode="404" redirect="index.html"/>
</customErrors>
</system.web>
</configuration>

Visual Studio Team Services release XML transformation doesn't work

Visual Studio Team Services - Build & Release
In the release definition, under File Transforms & Variable Substitution Options, there are XML transformation, and XML variable substitution.
I checked both checkboxes, but after deployment, nothing in my Web.Dev.config replaces web.config. The transformation doesn't happen at all.
What is the problem?
--------edit: detail---------
build
all the settings here is default.
release
web.dev.config
This transformation works fine if I deploy from visual studio 2015.
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add name="DefaultConnection" connectionString="Server=tcp:xxxx.database.windows.net,1433;Database=xxxx;User ID=xxx#xxx;Password=xxxx;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;" providerName="System.Data.SqlClient" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
<add name="NicoContext" connectionString="metadata=res://*/Nico.csdl|res://*/Nico.ssdl|res://*/Nico.msl;provider=System.Data.SqlClient;provider connection string="data source=tcp:xxxx.database.windows.net,1433;initial catalog=xxxx;User Id=xxxx#xxxx;Password=xxxx;App=EntityFramework"" providerName="System.Data.EntityClient" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
</system.web>
<appSettings>
<add key="Environment" value="Dev" xdt:Transform="SetAttributes" xdt:Locator="Match(key)"/>
<add key="AzureStorageContainerName" value="xxx" xdt:Transform="SetAttributes" xdt:Locator="Match(key)" />
<add key="StorageConnectionString" value="DefaultEndpointsProtocol=https;AccountName=xxx;AccountKey=xxx;EndpointSuffix=core.windows.net" xdt:Transform="SetAttributes" xdt:Locator="Match(key)" />
<add key="FacebookLoginAppId" value="xxx" xdt:Transform="SetAttributes" xdt:Locator="Match(key)"/>
<add key="FacebookLoginAppSecret" value="xxx" xdt:Transform="SetAttributes" xdt:Locator="Match(key)"/>
</appSettings>
</configuration>
--------edit 2: no longer work ---------
I did as the solution suggested on a new project in another Azure account, but this time it didn't work. For build, I choose template "Asp.net (preview)", for release, I choose template "Azure App Service Deployment".
--------edit 3: Release - Package or folder ---------
You have already deployed/published the web app, so the web.config has already been transformed (For web package deployment, the related values in web.config will be updated during web deploy, the values are in parameters.xml).
So, there isn’t other config files (e..g web.dev.config, web.release.config) in published folder and check XML transformation and XML variable substitution is useless.
Based on the build log, the web app build with release configuration, but there isn’t web.release.config, so there isn’t update for web.config.
You can refer to these steps to achieve your requirement:
Publish/deploy the web app with File System way (e.g. /p:WebPublishMethod=FileSystem /p:publishUrl= $(build.artifactstagingdirectory)\)
Add Copy file step copy others config files (web.dev.config, web.prod.config etc) to the published folder (artifact directory)
Add Publish Build Artifacts
For release, uncheck Publish using Web Deploy option and specify $(System.DefaultWorkingDirectory) to Package or folder.

The underlying provider failed to open , login failed for user IIS APPPOOL

i am not a sql server guy but i am working on a client's application and want to connect to the database through EF Code first
the Exception message that i have is
The underlying provider failed to open
The Exception details
Cannot open database [DatabaseName] requested by the login. the login failed
login failed for user 'IIS APPPOOL\ASP.NET v4.0"
My web config
<add name="TraininGoDB"
providerName="System.Data.SqlClient"
connectionString="Server=LOCALPCNAME\SQLEXPRESS;Database=[DATABASENAME];Integrated Security=True;"/>
The EF context and entities are defined in a separate project with the app config of the following
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="Data Source=(localdb)\v11.0; Integrated Security=True; MultipleActiveResultSets=True" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
</configuration>
i am using SQL Server Express 2008
don't know the problem from the database configration or from the web config
The user under which the web application pool (associated to your web application) is running doesn't have permissions to access your database. You need to grant it permissions or run under another user who has permissions. So, to summarize: check under which user your application pool is running, then check that that user has access to your database.
If all of your Web.config files are correct, SQLSERVER has the appropriate permissions, etc., there's one more thing you can check. I once had this issue when a client had me configure the project so that Entity Framework would not automatically drop the databases (if, for example, the models changed), but I was still testing the project on localhost. I thus needed to create a new database, but I forgot to fix my context files. For example, my problem was:
public MasterContext(string nameOrConnectionString) : base(nameOrConnectionString)
{
Database.SetInitializer<MasterContext>(null);
}
when it should have been (for the purpose of testing):
public MasterContext(string nameOrConnectionString) : base(nameOrConnectionString)
{
Database.SetInitializer<MasterContext>(new DropCreateDatabaseIfModelChanges<MasterContext>());
}
Otherwise, I would receive the same error, that the underlying provider failed on open, with the inner exception being that the login failed for the user.

Difference in Forms Authentication between Razor Preview and Razor Beta?

I'm attempting to upgrade an MVC project to Beta using Razor (from the Preview release) and am now experiencing strangeness with Razor not going to my login view that it use to go to (when someone asks for an action that required authorization).
My web config has
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" />
</authentication>
But whenever an action with the Authorize attribute is hit, the browser redirects to "Account/Login" - notice Log*in* NOT Log*On*. Anyone know how to fix this in MVC 3 Beta?
It is a known bug in Beta: Release Notes: Chapter Known Issues
There’s a known issue that causes Forms Authentication to always redirect unauthenticated users to /Account/Login, ignoring the forms authentication setting used in Web.config. The workaround is to add the following app setting.
<add key="autoFormsAuthentication" value="false" />
Try adding the following the <configuration> section of your application's Web.config file:
<appSettings>
<add key="enableSimpleMembership" value="false" />
</appSettings>
All you need is to disable the authentication mode="Forms".
I removed the authentication section and it started to work.
<!--
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" />
</authentication>
-->