This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<!-- 省略... --> | |
<runtime> | |
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | |
<dependentAssembly> | |
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/> | |
<codeBase version="11.0.0.0" href="bin/V11/Newtonsoft.Json.dll"/> | |
<codeBase version="12.0.0.0" href="bin/V12/Newtonsoft.Json.dll"/> | |
</dependentAssembly> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Reflection; | |
using System.Web; | |
using System.Web.Mvc; | |
using System.Web.Routing; | |
namespace VersionConflicts | |
{ | |
public class MvcApplication : System.Web.HttpApplication |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[System.Reflection.Assembly]::LoadFile("C:\Your\DLL\AbsolutePath\Newtonsoft.Json.dll").FullName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<!-- 省略... --> | |
<runtime> | |
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | |
<dependentAssembly> | |
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> | |
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="11.0.0.0" /> | |
</dependentAssembly> | |
</assemblyBinding> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Updates the Newtonsoft.Json package in every project of the solution to the latest version | |
Update-Package Newtonsoft.Json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ActionResult Index() | |
{ | |
Response.Write(SharedLibrary.Class1.SerializeObject()); | |
Response.Write("<br>"); | |
Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(new | |
{ | |
msg = "序列化自「應用程式」" | |
})); | |
return Content(""); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace SharedLibrary | |
{ | |
public class Class1 | |
{ | |
public static string SerializeObject() | |
{ | |
return Newtonsoft.Json.JsonConvert.SerializeObject(new | |
{ | |
msg = "序列化自「共用類別庫」" | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Web.Mvc; | |
namespace VersionConflicts.Controllers | |
{ | |
public class HomeController : Controller | |
{ | |
public ActionResult Index() | |
{ | |
Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(new | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpPost] | |
public ActionResult SendOrderEmail() | |
{ | |
var order = Models.OrderUtil.GetTestOrder(); | |
string subject = "測試主旨"; | |
ViewBag.remark = "寄送時間:" + DateTime.Now; | |
string body = JZLib.JZUtil.RenderViewToString(ControllerContext, "_OrderEmailTemplate", order); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model Models.Order | |
@{ | |
Layout = null; | |
} | |
訂單編號:@Model.order_id<br> | |
顧客E-mail:@Model.customer_email<br> | |
訂單明細<br> | |
<table border="1" cellpadding="5"> | |
<tr> |
NewerOlder