Skip to content

Commit

Permalink
Newtonsoft reference fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchitmehta committed Jul 31, 2020
1 parent 5d43bff commit eedefce
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Kudu.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ private static IEnvironment GetEnvironment(string siteRoot, string requestId)
EnvironmentHelper.NormalizeBinPath(binPath),
repositoryPath,
requestId,
Path.Combine(AppContext.BaseDirectory, "KuduConsole", "kudu.dll"),
Path.Combine(AppContext.BaseDirectory, "KuduConsole", "kudu"),
null,
new FileSystemPathProvider(new NullMeshPersistentFileSystem()));
}
Expand Down
2 changes: 1 addition & 1 deletion Kudu.Contracts/IEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public interface IEnvironment
string FunctionsPath { get; } // e.g. /site/wwwroot
string AppBaseUrlPrefix { get; } // e.g. siteName.azurewebsites.net
string RequestId { get; } // e.g. x-arr-log-id or x-ms-request-id header value
string KuduConsoleFullPath { get; } // e.g. KuduConsole/kudu.dll
string KuduConsoleFullPath { get; } // e.g. KuduConsole/kudu
string SitePackagesPath { get; } // e.g. /data/SitePackages
bool IsOnLinuxConsumption { get; } // e.g. True on Linux Consumption. False on App Service.
}
Expand Down
2 changes: 1 addition & 1 deletion Kudu.Core/SourceControl/Git/KnownEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal static class KnownEnvironment
// Command to launch the post receive hook for dynamic install
// CORE NOTE modified the script to run "dotnet," assuming EXEPATH points
// to a framework-dependent Core app.
public static string KUDUCOMMAND_DYNAMICINSTALL = "dotnet \"$" + EXEPATH + "\" " +
public static string KUDUCOMMAND_DYNAMICINSTALL = "\"$" + EXEPATH + "\" " +
"\"$" + APPPATH + "\" " +
"\"$" + MSBUILD + "\" " +
"\"$" + DEPLOYER + "\"";
Expand Down
5 changes: 3 additions & 2 deletions Kudu.Services.Web/Kudu.Services.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Proxy" />
<PackageReference Include="Microsoft.Diagnostics.Runtime" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
<PackageReference Include="XmlSettings" Version="0.1.3" />
</ItemGroup>
Expand Down Expand Up @@ -56,8 +57,8 @@
<Message Text="%0a%0aBuilding KuduConsole%0a" Importance="high" />
<Exec Command="dotnet build ../Kudu.Console -o $(MSBuildProjectDirectory)/$(PublishDir)..\KuduConsole" Condition="'$(Configuration)' == 'Debug' AND '$(OS)' == 'Windows_NT'" />
<Exec Command="dotnet build ../Kudu.Console -o $(OutputPath)/KuduConsole" Condition="'$(Configuration)' == 'Debug' AND '$(OS)' != 'Windows_NT'" />
<Exec Command="dotnet publish ..\Kudu.Console --configuration Release -o $(PublishDir)\KuduConsole" Condition="'$(Configuration)' == 'Release' AND '$(OS)' == 'Windows_NT'" />
<Exec Command="dotnet publish ../Kudu.Console --configuration Release -o $(PublishDir)/KuduConsole" Condition="'$(Configuration)' == 'Release' AND '$(OS)' != 'Windows_NT'" />
<Exec Command="dotnet publish ..\Kudu.Console -r linux-x64 --self-contained --configuration Release -o $(PublishDir)\KuduConsole" Condition="'$(Configuration)' == 'Release' AND '$(OS)' == 'Windows_NT'" />
<Exec Command="dotnet publish ../Kudu.Console -r linux-x64 --self-contained --configuration Release -o $(PublishDir)/KuduConsole" Condition="'$(Configuration)' == 'Release' AND '$(OS)' != 'Windows_NT'" />
</Target>
<Target Name="ChangeScriptPermissionsForLinux" AfterTargets="publish">
<Message Text="%0a%0aSetting Permissions for Kudu Script(s)%0a" Importance="high" />
Expand Down
2 changes: 1 addition & 1 deletion Kudu.Services.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ private static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
.UseKestrel(options => { options.Limits.MaxRequestBodySize = null; })
.UseStartup<Startup>();
}
}
}
4 changes: 4 additions & 0 deletions Kudu.Services.Web/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ public void ConfigureServices(IServiceCollection services)
var kuduServicesAssembly = Assembly.Load("Kudu.Services");

services.AddMvcCore(options => options.EnableEndpointRouting = false)
.AddNewtonsoftJson(o =>
{
o.SerializerSettings.ContractResolver = new DefaultContractResolver();
})
.AddRazorPages()
.AddAuthorization()
.AddApplicationPart(kuduServicesAssembly).AddControllersAsServices()
Expand Down
2 changes: 1 addition & 1 deletion Kudu.Tests/TestMockedIEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class TestMockedIEnvironment : IEnvironment
public string _FunctionsPath = "/site/wwwroot";
public string _AppBaseUrlPrefix = "siteName.azurewebsites.net";
public string _RequestId = "00000000-0000-0000-0000-000000000000";
public string _KuduConsoleFullPath = "KuduConsole/kudu.dll";
public string _KuduConsoleFullPath = "KuduConsole/kudu";
public string _SitePackagesPath = "/data/SitePackages";
public bool _IsOnLinuxConsumption = false;

Expand Down

0 comments on commit eedefce

Please sign in to comment.