Can't use SharpSvn on IIS Express - iis

When I try and create an instance of SharpSvn.SvnClient on my local development system, I'm getting System.InvalidProgramException (SharpSvn.SvnClient..ctor() in g:\dist\src\sharpsvn\svnclient.cpp:36). I'm using 32bit IIS Express 8.0 with Clr4IntegratedAppPool, 32bit version of SharpSvn, .Net 4.5, the build targets x86. I have the startup element in my Web.config file:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
<supportedRuntime version="v2.0.50727"/>
</startup>
After I publish my Web to IIS on a different system, it works just fine.
What am I doing wrong?

This startup flag is required whem creatimg the proces. This web.config file is parsed a bit later.
But I have news for you: Later this week there will be new SharpSvn builds available, with binaries for both .NET 2.0 and .NET 4.0. The 4.0 build won't need this flag.
[2014-04-16: The new binaries are finally pushed to our site and to NuGet]

Related

Failed to Start Process with Commandline VSIISExeLauncher.exe in IIS 10.0

Thursday night, I was working on a project built in ASP.NET Core 2.1 (being prepared for ASP.NET Core 2.2) running on my local IIS 10.0 (not IIS Express) and was able to run it without any issue. Friday morning, after heading into the office, I was met with the following error every time I try to run my solution in Visual Studio:
Unable to start process C:\Program Files (x86)\dotnet\dotnet.exe. The web server request failed with status code 502, Bad Gateway. The full response has been written to [file_name].html.
When I open the [file_name].html, I'm given the response:
HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure
When I open the Event Viewer, I'm given the response:
Application 'MACHINE/WEBROOT/APPHOST/DEFAULT WEB SITE/[Path]' with physical root '[Path]' failed to start process with commandline '[Path]\bin\IISSupport\VSIISExeLauncher.exe -argFile IISExeLauncherArgs.txt', ErrorCode = '0x800700c1' : 0.
I have:
Turned off and on the IIS through Windows Features, making sure the correct Internet Information Services features were checked
Created an Application Pool where [.NET CLR version] is set to "No Managed Code" and [Managed pipeline mode] is set to "Integrated"
Uninstalled and Reinstalled: IIS Url Rewrite to IIS
Uninstalled and Reinstalled: Microsoft .NET Core SDK - 2.1.504 (x64)
Uninstalled and Reinstalled: Microsoft .NET Core SDK - 2.1.504 (x84)
Uninstalled and Reinstalled: Microsoft .NET Core SDK - 2.2.104 (x64)
Uninstalled and Reinstalled: Microsoft .NET Core SDK - 2.2.104 (x84)
Uninstalled and Reinstalled: Microsoft .NET Core Runtime - 2.1.8 (x64)
Uninstalled and Reinstalled: Microsoft .NET Core Runtime - 2.1.8 (x86)
Uninstalled and Reinstalled: Microsoft .NET Core Runtime - 2.2.2 (x64)
Uninstalled and Reinstalled: Microsoft .NET Core Runtime - 2.2.2 (x86)
Uninstalled and Reinstalled: Microsoft .NET Core 2.1.8 - Windows Server Hosting
Uninstalled and Reinstalled: Microsoft .NET Core 2.2.2 - Windows Server Hosting
Restarted my computer after ever re-installation
What else can I try because none of my other projects are working either.
In my case this issue occurred when I manually cleared the bin folder (which deleted the necessary files in the IISSupport folder) and tried to load the application which was set up as an application under my localhost in IIS.
To solve all I needed to do was to run the application through Visual Studio, which added the necessary IISSupport folder and files to the bin.
I got this fixed by re-installing the Visual studio. Still I'm not sure if this is the best way to fix this.
I've also tried all the approaches mentioned in this question but nothing fixed the issue.
I found the solution.
In the root folder of my team's project, there was an empty "file" file titled "The". For the sake of things, our project is called "The Project" with a space between the words. I removed this file and everything built fine.
My guess is that getting the latest files from our Teams server must have generated a half-formed file and messed with the build of my project.
In my case, my project was setup as a website in IIS and the file "bin\IISSupport\VSIISExeLauncher.exe" was missing in the project's directory.
I simply selected "IIS" when debugging the project in Visual Studio 2019 and it generated the missing file. It also generated 2 text files (IISExeLauncherArgs.txt, pidfile.txt) in the IISSupport folder, made changes to my web.config file, and my project ran successfully.
After that I was able to access the local website that was setup in IIS without running it in Visual Studio.
In my case, the issue is in launchSettings.json.
First, make sure which profile you are running while click run button.
my case is 'IIS Express',
Then open the file, go to =>Profiles, make sure the command name in IIS Express profile.
my case is IIS. more details about command name.
And check iisSettings in above section.
my case is using IIS as command, so I check iis => applictionUrl and sslPort.
the issue is here, the application url is using a different domain name.
which is different from the launch URL. once i republish the website on my local dev box using the launch url domain, it works fine. BTW, we use host file to fake those domain names.
if you have other team members working on the same project, make sure you all use same settings of the dev web site. or developers can just edit it locally, do not check in the settings if it could not work on other developer's machine.
in my case i solved the error deleting the .vs folder on the project root and i restarted visual studio.
I had an issue with failed to start process with commandline on the remote IIS. I had to add the web.config to the project and ensure it would be published. The default file looks like below:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!-- To customize the asp.net core module uncomment and edit the following section. For more info see https://go.microsoft.com/fwlink/?linkid=838655 -->
<system.webServer>
<handlers>
<remove name="aspNetCore" />
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
</system.webServer>
</configuration>
I replaced %LAUNCHER_PATH% with dotnet and %LAUNCHER_ARGS% with .\MyProjectNameHere.dll like
<aspNetCore processPath="dotnet" arguments=".\Web.Api.V3.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess">

HTTP Error 500.19 - Internal Server Error in windows server 2012 R2

I'm trying to install a dotnet core application in IIS on a machine with windows server 2012 R2 installed, but I'm getting Error 500.19 with the following characteristics:
According to my searches, I already tested the following solutions:
I used a xml validator to validate both webconfig and applicationHost;
I uninstalled all versions of dotnet core and installed just the 2.1.1 bundle (with hosting and runtime);
I copied the project to another machine, with windows 10 installed and with dotnet core 2.1.1, and it works, but not in the machine I want;
I checked all the IIS features following this link;
I changed ApplicationPool to No Managed Code;
I also noticed that doing dotnet --version on command line it was not working, I fixed that (now it's working as supposed, saying that I need SDK to do this operation).
Following is my IIS information:
And next is my webconfig:
So, any idea why I'm still getting this error.
I appreciate some help =).
Thanks in advance.
UPDATE
I noticed that removing a line on my web.config I can access some functionalities of IIS without giving me the Error 0x8007000d. This is the line:
<aspNetCore requestTimeout="00:10:00" processPath="dotnet" arguments=".\Glintt.BedSide.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
So the problem is obviously here. Any idea why this line generates this error?
You need to install .NET Core 2.2 Runtime & Hosting Bundle for Windows.
This version for example: .NET Core 2.2 Runtime & Hosting Bundle for Windows

ASP.NET Core website on Azure fails to start with a 502.5 error after upgrade from .NET Core 1.1.1 to .NET Core 1.1.2

I have a .NET Core web application which I deploy as an Azure Web App.
This has been working perfectly until last night when I applied the Visual Studio 2017 upgrade (v15.2).
The .net core version was upgraded from 1.1.1 to 1.1.2. When I deploy to Azure the website fails to start with a 502.5 error.
After investigating I can see .NET Core 1.1.2 is not deployed to the Azure image.
I cannot install the new framework to the web app instance (understandably permission is denied on the Program Files directory). I cannot 'downgrade' through the nuget package manager as it reports the version is 'Blocked by the project'. I cannot see a way to define the version of Microsoft.NETCore.App in the csproj file as it seems this is 'automagically' controlled by the root <Project Sdk="Microsoft.NET.Sdk.Web"> element.
I have tried attempting a self contained deployment (shipping the framework with the web app) but can't get this working either.
Short of waiting for the new version to be deployed to Azure (I can't find any information on their schedule for this) does anyone have any ideas on how to get the web app working again?
Is there any way to force it to run under 1.1.1?
Update 5/12/2017: we have accelerated the deployment of 1.1.2 and 1.0.5 to App Service and it is now complete. So the workaround below should no longer be needed by anyone.
Original solution
The best workaround is to set this in your .csproj file:
<TargetFramework>netcoreapp1.1.1</TargetFramework>
Instead of it being set to netcoreapp1.1. We will have 1.1.2 deployed to Azure App Service by Tuesday, at which point the workaround won't be necessary.
Note that if if you set it to netcoreapp1.1.1, once 1.1.2 is available it will auto-roll forward to that. So setting it to netcoreapp1.1.1 does not keep you 'stuck' to that version. This is true as long as you use Portable mode (i.e. rely on the framework that's on the OS). If you use standalone and deploy your own framework, then you would be stuck to it (but then you would not have had this issue in the first place and would not have needed to do that!).
We are having the same issue after the Visual Studio 2017 Update.
A workaround is to edit the web.config for your site in Kudu after it has been deployed.
Add --fx-version 1.1.1 at the start of the arguments value for the aspNetCore entry under system.webServer
e.g
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="--fx-version 1.1.1 PATH_TO_DLL" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
Until they get around to deploying 1.1.2 to the web app images I managed to fix this by forcing the project to reference Microsoft.NETCore.App 1.1.1
Edit the csproj file:
<ItemGroup>
<PackageReference Update="Microsoft.NETCore.App" Version="1.1.1" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
... etc

How to register Dot net framework 4.6.2 on IIS 8.5 in Windows Server 2012 R2

I installed dot net framework 4.6.2 from this path & now want to register this in IIS.
If it was a earlier framework version (2.0,3.5,etc ) & an earlier server ( For Eg Windows 2003), I would have typed the following command
in the appropriate path.
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis -i
However, I cannot find the folder path of 4.6.2 on this server. & even installing this command from here gives the below message :
Microsoft (R) ASP.NET RegIIS version 4.0.30319.0 Administration
utility to install and uninstall ASP.NET on the local machine.
Copyright (C) Microsoft Corporation. All rights reserved. Start
installing ASP.NET (4.0.30319.0). This option is not supported on
this version of the operating system. Administrators should instead
install/uninstall ASP.NET 4.5 with IIS8 using the "Turn Windows
Features On/Off" dialog, the Server Manager management tool, or the
dism.exe command line tool. For more details please see
http://go.microsoft.com/fwlink/?LinkID=216771. Finished installing
ASP.NET (4.0.30319.0).
I know the web link in message is for 4.5 because 4.5 is an in-place upgrade for 4.0.
My website gives this error :
The 'targetFramework' attribute in the element of the
Web.config file is used only to target version 4.0 and later of the
.NET Framework (for example, '').
The 'targetFramework' attribute currently references a version that is
later than the installed version of the .NET Framework. Specify a
valid target version of the .NET Framework, or install the required
version of the .NET Framework.
The relevant part of web.config is :
<system.web>
<compilation debug="true" targetFramework="4.6.2"/>
<httpRuntime targetFramework="4.6.2"/>
</system.web>
It turns out I had downloaded a wrong installer. it was of 4.6 whereas I needed 4.6.2 which is available here.
The question deserves deletion but i wont coz some one else might commit the same sin.
For applications with target framework 4.6, register with these paths (depends on x64 or x86 version of Windows):
X86: %windir%\Microsoft.NET\Framework\v4.0.30319
X64: %windir%\Microsoft.NET\Framework64\v4.0.30319
In command prompt, first got to one of above directory
then run
aspnet_regiis.exe -i
In Application Pool setting use .Net Framework v4.0.30319
IIS will not display the .NET 4.6.2 application pool when you select the .NET CLR version for application pool. Both 4.0 and 4.6.2 will use .NET CLR Version v4.0.30319.
Here is the link for reference:
https://forums.iis.net/t/1237493.aspx?Link+net+framework+4+6+2+windows+2012R2+to+IIS

Reboot not required for .NET 4.0 after VS2012 runtime installation

My WPF application was running fine when built on VS2010 and using WiX3.5. I changed to VS2012 and installed the VS2012 runtime using Wix as below:
<DirectoryRef Id="TARGETDIR">
<Merge Id="VC110RedistCRT" SourceFile="C:\Program Files (x86)\Common Files\Merge Modules\Microsoft_VC110_CRT_x86.msm" DiskId="1" Language="0"/>
<Merge Id="VC110RedistMFC" SourceFile="C:\Program Files (x86)\Common Files\Merge Modules\Microsoft_VC110_MFC_x86.msm" DiskId="1" Language="0"/>
</DirectoryRef>
<Feature Id="VC110Redist" Title="Visual C++ 11.0 Runtime" AllowAdvertise="no" Display="hidden" Level="1">
<MergeRef Id="VC110RedistCRT"/>
<MergeRef Id="VC110RedistMFC"/>
</Feature>
Earlier with VS2010, application installation on new machine used to ask for reboot while installing .NET framework. Now with VS2012, it doesn't ask for reboot and application is running fine also.
I just wanted to know the possible reason and any side effects of this. Any details of how the C++ runtime and .Net Framework installation work with each other will be helpful.
Thanks

Resources