Does the Sage 50 SDK support web applications? I'm attempting to create an ASP.NET application to talk with Sage back and forth.
I added the API to the website with it simply starting a session but I receive an expection:
Could not load file or assembly 'Sage.Peachtree.Domain, Version=2017.0.0.70, Culture=neutral, PublicKeyToken=d06c16dde04d83e4' or one of its dependencies. The system cannot find the file specified.
Target framework: .NET Framework 4.5.2
Platform target: x86
My code is as follows
Global.asax.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Sage.Peachtree.API.Resolver;
using Sage.Peachtree.API;
namespace ASPSageAPITest
{
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
Sage.Peachtree.API.Resolver.AssemblyInitializer.Initialize();
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
}
}
HomeController.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Sage.Peachtree.API.Resolver;
using Sage.Peachtree.API;
namespace ASPSageAPITest.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
var apiSession = new PeachtreeSession();
apiSession.Begin(string.Empty);
return View();
}
}
}