Skip to content

Commit eedefce

Browse files
committed
Newtonsoft reference fix
1 parent 5d43bff commit eedefce

7 files changed

Lines changed: 12 additions & 7 deletions

File tree

Kudu.Console/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ private static IEnvironment GetEnvironment(string siteRoot, string requestId)
289289
EnvironmentHelper.NormalizeBinPath(binPath),
290290
repositoryPath,
291291
requestId,
292-
Path.Combine(AppContext.BaseDirectory, "KuduConsole", "kudu.dll"),
292+
Path.Combine(AppContext.BaseDirectory, "KuduConsole", "kudu"),
293293
null,
294294
new FileSystemPathProvider(new NullMeshPersistentFileSystem()));
295295
}

Kudu.Contracts/IEnvironment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public interface IEnvironment
2929
string FunctionsPath { get; } // e.g. /site/wwwroot
3030
string AppBaseUrlPrefix { get; } // e.g. siteName.azurewebsites.net
3131
string RequestId { get; } // e.g. x-arr-log-id or x-ms-request-id header value
32-
string KuduConsoleFullPath { get; } // e.g. KuduConsole/kudu.dll
32+
string KuduConsoleFullPath { get; } // e.g. KuduConsole/kudu
3333
string SitePackagesPath { get; } // e.g. /data/SitePackages
3434
bool IsOnLinuxConsumption { get; } // e.g. True on Linux Consumption. False on App Service.
3535
}

Kudu.Core/SourceControl/Git/KnownEnvironment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ internal static class KnownEnvironment
2222
// Command to launch the post receive hook for dynamic install
2323
// CORE NOTE modified the script to run "dotnet," assuming EXEPATH points
2424
// to a framework-dependent Core app.
25-
public static string KUDUCOMMAND_DYNAMICINSTALL = "dotnet \"$" + EXEPATH + "\" " +
25+
public static string KUDUCOMMAND_DYNAMICINSTALL = "\"$" + EXEPATH + "\" " +
2626
"\"$" + APPPATH + "\" " +
2727
"\"$" + MSBUILD + "\" " +
2828
"\"$" + DEPLOYER + "\"";

Kudu.Services.Web/Kudu.Services.Web.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<ItemGroup>
2929
<PackageReference Include="Microsoft.AspNetCore.Proxy" />
3030
<PackageReference Include="Microsoft.Diagnostics.Runtime" />
31+
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" />
3132
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
3233
<PackageReference Include="XmlSettings" Version="0.1.3" />
3334
</ItemGroup>
@@ -56,8 +57,8 @@
5657
<Message Text="%0a%0aBuilding KuduConsole%0a" Importance="high" />
5758
<Exec Command="dotnet build ../Kudu.Console -o $(MSBuildProjectDirectory)/$(PublishDir)..\KuduConsole" Condition="'$(Configuration)' == 'Debug' AND '$(OS)' == 'Windows_NT'" />
5859
<Exec Command="dotnet build ../Kudu.Console -o $(OutputPath)/KuduConsole" Condition="'$(Configuration)' == 'Debug' AND '$(OS)' != 'Windows_NT'" />
59-
<Exec Command="dotnet publish ..\Kudu.Console --configuration Release -o $(PublishDir)\KuduConsole" Condition="'$(Configuration)' == 'Release' AND '$(OS)' == 'Windows_NT'" />
60-
<Exec Command="dotnet publish ../Kudu.Console --configuration Release -o $(PublishDir)/KuduConsole" Condition="'$(Configuration)' == 'Release' AND '$(OS)' != 'Windows_NT'" />
60+
<Exec Command="dotnet publish ..\Kudu.Console -r linux-x64 --self-contained --configuration Release -o $(PublishDir)\KuduConsole" Condition="'$(Configuration)' == 'Release' AND '$(OS)' == 'Windows_NT'" />
61+
<Exec Command="dotnet publish ../Kudu.Console -r linux-x64 --self-contained --configuration Release -o $(PublishDir)/KuduConsole" Condition="'$(Configuration)' == 'Release' AND '$(OS)' != 'Windows_NT'" />
6162
</Target>
6263
<Target Name="ChangeScriptPermissionsForLinux" AfterTargets="publish">
6364
<Message Text="%0a%0aSetting Permissions for Kudu Script(s)%0a" Importance="high" />

Kudu.Services.Web/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ private static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
2121
.UseKestrel(options => { options.Limits.MaxRequestBodySize = null; })
2222
.UseStartup<Startup>();
2323
}
24-
}
24+
}

Kudu.Services.Web/Startup.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ public void ConfigureServices(IServiceCollection services)
8686
var kuduServicesAssembly = Assembly.Load("Kudu.Services");
8787

8888
services.AddMvcCore(options => options.EnableEndpointRouting = false)
89+
.AddNewtonsoftJson(o =>
90+
{
91+
o.SerializerSettings.ContractResolver = new DefaultContractResolver();
92+
})
8993
.AddRazorPages()
9094
.AddAuthorization()
9195
.AddApplicationPart(kuduServicesAssembly).AddControllersAsServices()

Kudu.Tests/TestMockedIEnvironment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class TestMockedIEnvironment : IEnvironment
3434
public string _FunctionsPath = "/site/wwwroot";
3535
public string _AppBaseUrlPrefix = "siteName.azurewebsites.net";
3636
public string _RequestId = "00000000-0000-0000-0000-000000000000";
37-
public string _KuduConsoleFullPath = "KuduConsole/kudu.dll";
37+
public string _KuduConsoleFullPath = "KuduConsole/kudu";
3838
public string _SitePackagesPath = "/data/SitePackages";
3939
public bool _IsOnLinuxConsumption = false;
4040

0 commit comments

Comments
 (0)