JetBrain Rider , Access denied when using IIS Express with Windows Authentication - windows-authentication

I have an enabled Windows Authentication on my projects. When I run it from Rider, it always prompts me "access denied". It's working fine when I run it via Visual Studio.
How can I solve this?

Navigate to: <project>.idea/config/applicationhost.config
Find the tag <authentication> and enable the <windowsAuthentication> tag like so: <windowsAuthentication enabled="true">
Mine looks like this:
<windowsAuthentication enabled="true">
<providers>
<add value="Negotiate" />
<add value="NTLM" />
</providers>
</windowsAuthentication>

Work-in-progress by JetBrains, see issue RIDER-15230
Just to build on #RyanDawkins answer with a GUI equivalent.
Steps
Right-click the Project the web app launches from
Select Properties ...
In the Modal, under Properties > Web there is a checkbox for Windows authentication
Screenshot
This is similar to the Visual Studio way of doing things, it just saves the settings in {SolutionFolder}/.idea/config instead of {SolutionFolder}/.vs/config

In <project>.idea/config/applicationhost.config
I had to do two things:
Set: <windowsAuthentication enabled="true">
Set: <anonymousAuthentication enabled="false">

Related

The V2 feed at ‘…’ returned an unexpected status code '503 Service Unavailable'

I know there are similar questions, but none with this exact error, so I'm hoping there is a different answer.
I'm getting the error:
[feedname] The V2 feed at 'http://domain.tld/NuGetServer/nuget/Search()?$filter=IsLatestVersion&searchTerm=''&targetFramework='net46'&includePrerelease=false&$skip=0&$top=26&semVerLevel=2.0.0' returned an unexpected status code '503 Service Unavailable'.
I recieve this failure in the Package Manager UI in Visual Studio (2017 Professional), as well as the Console in VS. I have tried clearing the NuGet caches, TFS caches, checking (and modifying, as appropriate) proxy settings for NuGet (AppData\Local), proxy settings for TFS, Internet Options proxy settings, with apparently no change in results. I also tried accessing the feed in VS 2010, and it doesn't work there as well.
Why could this be happening? It seems like a proxy-related issue, but I've tried everything that other questions mention, and to no avail.
One clue might be the following: When I access the feed URL via a browser, I get the following back:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xml:base="http://domain.tld/NuGetServer/nuget/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
<title type="text">Search</title>
<id>http://domain.tld/NuGetServer/nuget/Search</id>
<updated>2018-06-25T21:31:57Z</updated>
<author>
<name />
</author>
<link rel="self" title="Search" href="Search" />
</feed>
This is what I get when excluding the Search parameters:
<service xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app" xml:base="http://domain.tld/NuGetServer/nuget/">
<workspace>
<atom:title>Default</atom:title>
<collection href="Packages">
<atom:title>Packages</atom:title>
</collection>
</workspace>
</service>
The NuGet server was configured incorrectly. I'm not exactly sure what the issue was, but once the server was re-configured to be have the default settings, and the URL in Visual Studio matched the server-configured URL, the issue was resolved.

AjaxControlToolkit 7.0123 breaks VS2012 Web Application Project

I have an existing VS2012 web application that has been running fine until I added in the latest AjaxControlToolkit (7.0123). Initially, I found that the installation broke the behaviour of the UpdatePanel - whereas before I could refresh a page after an asynchronous post-back without repeating the operation I found that after installation the refresh would repeat the previous operation (I guess the post-back was no longer asynchronous).
I then noticed that, at some time in the past, I had commented out a number of the default JavaScript files that are added to a new ASP.NET Web Forms Application so I tried adding them back in. This resulted in an exception:
'MsAjaxBundle' is not a valid script name. The name must end in
'.js'.
I then tried replacing the default <asp:ScriptManager .../> with <ajaxControlToolkit:ToolkitScriptManager .../> this resulted in a new exception
Could not load file or assembly 'System.Web' or one of its
dependencies. The system cannot find the file specified.
For sanity, I then created a fresh ASP.NET Web Forms Application (VS2012, Update 2) and ran it. No errors. Using "nuget", I then added the AjaxControlToolkit v7.0123 (the latest release). Ran the application again and I get the original exception again:
'MsAjaxBundle' is not a valid script name. The name must end in
'.js'.
Once again, I replaced <asp:ScriptManager .../> with <ajaxControlToolkit:ToolkitScriptManager .../> and once again this results in
Could not load file or assembly 'System.Web' or one of its
dependencies. The system cannot find the file specified.
Can anybody shed any light on what else I need to do to resolve this? I can find no documentation to say anything needs to be changed manually when adding the toolkit.
Thanks,
Answer found at http://stephenwalther.com/archive/2012/09/20/september-2012-release-of-the-ajax-control-toolkit.aspx (always just after posting the question huh)
Replacing <asp:ScriptManager .../> with <ajaxControlToolkit:ToolkitScriptManager .../> is correct
Need to remove reference to MsAjaxBundle
Need to remove Assembly="System.Web" from script references
This fixes the exceptions (both in the new project and the original).
It does not however resolve the problem with the UpdatePanel no longer posting back asynchronously. I will raise this as a new question.
If you are using the April 2013 Release of the Ajax Control Toolkit see Stephen Walther's latest blog post:
http://stephenwalther.com/archive/2013/04/30/april-2013-release-of-the-ajax-control-toolkit.aspx
I was missing the new web.config settings that allow the AjaxFileUpload control to work in the new release
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" maxRequestLength="42949672" />
<httpHandlers>
<add verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit"/>
</httpHandlers>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<add name="AjaxFileUploadHandler" verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit"/>
</handlers>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="4294967295"/>
</requestFiltering>
</security>
</system.webServer>
</configuration>
When you see this "'MsAjaxBundle' is not a valid script name. The name must end in '.js'."
The Best thing you can do is:
Go to the site Master (Double click on it )
Search for "MsAjaxBundle" or " "
Comment this line eg. <%----%>
Save or compile your program and then run it
Thank God is working by now

ASP.NET ReportViewer works in development, is empty when deployed

I have a ASP.NET web app that utilizes ReportViewer to show local reports. Everything works beautifully on my development machine (XP Pro, Visual Studio 2008). When I deploy the app to the production server (Windows Server 2008, IIS 7), the site works very well, except for the report viewer. When I generate the report, the report viewer remains empty.
I have written debugging code to verify that the records are being received from the database, and they are. No error occurs but, no records are show in the report viewer. Also, the images that normally appear in the menu bar of the ReportViewer control (export button, print button, forward and back buttons, etc) do not load either.
I ran the ReportViewer.exe on the server to install the appropriate files, and I have verified that they are in the GAC of the machine.
Can anyone suggest a way to debug this...it would be easier if an error was being generated (I can't believe I just said that)?
Please verify that you have the required web.config entries. My suspicion is that you are missing the entry in system.webServer/handlers, which is required in IIS7. IIS7 pretty much ignores the system.web/httpHandlers section, which may explain why it works in IIS 5.1 (XP) but not in 7.
Version numbers may vary, but this should cover it for entries:
In the system.web/compilation section:
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</buildProviders>
In the system.web/httpHandlers section
<add path="Reserved.ReportViewerWebControl.axd"
verb="*"
type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
validate="false" />
And in the system.webServer/handlers section:
<add name="ReportViewer"
path="Reserved.ReportViewerWebControl.axd"
verb="*"
type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
preCondition="integratedMode" />

ReplacableToken_ when using web.config transform?

I have a web.config with 2 transforms - for debug and release.
web.config:
<connectionStrings>
<clear />
<add name="StrName" connectionString="data source=.\sqlexpress;User Id=sa;Password=pass;Database=SocialBot;"
providerName="System.Data.SqlClient" />
</connectionStrings>
I just copied the example given and replaced the name with StrName. I end up with :
<add name="StrName" connectionString="$(ReplacableToken_SocialBotConnectionString-Web.config Connection String_0)"
providerName="System.Data.SqlClient" />
What the hell is ReplacableToken_ ?
I have another project and it works with no problem there.
If, like me, you're running up against this problem while trying to automate your build process using msbuild from the command line. Specifically, the parameter you need to set is:
/p:AutoParameterizationWebConfigConnectionStrings=False
This is most likely what VS is doing on your behalf when you publish to the filesystem
If you want to build with Visual Studio 2010, add the following line to your configuration PropertyGroup in your .csproj:
<AutoParameterizationWebConfigConnectionStrings>False</AutoParameterizationWebConfigConnectionStrings>
More details here:
How to get rid of "$(ReplacableToken...)" in web.config completely

Crystal Reports images not visible in web viewer

I have some Crystal Reports (V10) in an application (.NET 1.1) I inherited that is deployed in four "identical" environments. In three of the environments, they are working fine. In the fourth, the chart graphics are not visible in the web viewer. They are visible if you export the reports.
The IT guys swear everything is exactly the same in all four environments and have kicked the problem back to me to solve. I'm not sure how I'm going to do that since I can't get to the servers to check anything for myself. But I don't see how this can NOT be an environment issue.
It seems to me that Crystal has the necessary permissions to write the file and to retrieve it to render the export versions of the report, but the ASP WP can't access the graphic file when the page is rendered.
Thanks for any suggestions you might have to help me!
RESOLUTION
From the IT guys: "We had to change the “Execute Permissions” on the CrystalReportsViewer10 folder within IIS from “Scripts only” to “Scripts and executables”. All of the other sites have only “Scripts Only” and they’re fine."
I could resolve this issue in dev enviroment adding next keys (handlers) to web.config:
<system.webServer>
<handlers>
<add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode"/>
</handlers>
</system.webServer>
<system.web>
<httpHandlers>
<add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
</httpHandlers>
</system.web>
There needs to be an IIS virtual directory called something like "CrystalReportViewers115". I think that the exact name changes between versions. This needs to be visible to your ASP.NET user. Start looking at the environments that work and see if they have this virtual directory installed, and compare it to the one on the failing environment. As another check, you should be able to enter in the URL for the images into a browser and see them. To find out the URL, right click on the picture and select "Properties". For example:
http://localhost/crystalreportviewers/images/toolbar/export.gif
You should see the picture when you browse directly to the URL.
Go to Start->Programs->Microsoft Visualstudio 2008->Visual Studio Tools->Visual Studio 2008 Command Prompt
and type
aspnet_regiis -c
This will automatically copied the corresponding files...
Add the aspnet_client folder in the source folder of the site. Example:
C:\inetpub\wwwroot\myapplication\aspnet_client\system_web\4_0_30319\CrystalReportWebFormViewer4
I recently experienced this very issue: although my resolution was a little different:
I tried setting the handler in the web.config but that didn't fix it.
I tried setting scripts & executables in IIS but that didn't fix it.
Once I went into the C:\Program Files\Common Files\Crystal Decisions\2.5\crystalreportviewers10 folder and turned off custom errors I could see the error was coming from an access denied issue on C:\Windows\Temp\
The solution was then to not and handlers or alter IIS to run scripts and executables, it was to allow the Network Service to read permission on C:\Windows\Temp\
EDIT:
Think I've found another solution which doesn't require permission changes... just set a virtual directory for aspnet_client; the level at which you select this will very much depend on your IIS layout.