Base solution for your next web application

Activities of "rickwheeler"

Hi, I'm new to Abp and also having this connection issue. I'm using VS2015 and SQL Express as per the standard installation. My connection string is:

<add name="Default" connectionString="Server=(localdb)MSSQLLocalDB; Database=FreightHub; Trusted_Connection=True;" providerName="System.Data.SqlClient" />

I can connect to database server in SQL Server Object Explorer and also in SQL 2014 Management Studio. However the Package Manager console always fails with the following error:

Target database is: 'FreightHub' (DataSource: (localdb)MSSQLLocalDB, Provider: System.Data.SqlClient, Origin: Configuration).
System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) ---> System.ComponentModel.Win32Exception (0x80004005): The network path was not found

Please help!

Hi, I have found a workaround to this issue by changing the Web.config connection entry to:

&lt;add name=&quot;Default&quot; connectionString=&quot;Server=(localdb)\ProjectsV13; Database=FreightHub; Trusted_Connection=True;&quot; providerName=&quot;System.Data.SqlClient&quot; /&gt;

This works for now but is version specific and I'd still like to figure out why (localdb)MSSQLLocalDB is not working. Any suggestion would be appreciated. Rick.

Hi, I've just recently discovered ASP.NET Boilerplate and super excited about the potential. I'm also looking some additional features you described, including the following:

  1. ASPnetzero framework - <a class="postlink" href="http://www.aspnetzero.com/">http://www.aspnetzero.com/</a> a) Self Registration of organisation – Multi tenant, multi page. b) User Management by Admin users c) General Admin and payment etc.
  2. Metronic - <a class="postlink" href="http://www.keenthemes.com/preview/metro">http://www.keenthemes.com/preview/metro</a> ... ard_3.html
  3. SignalR - <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/">http://www.aspnetboilerplate.com/Pages/</a> ... ntegration
  4. Payment gateway to create invoices, and manage recurring payments eg Paypal.

The mapping stuff is of interest too but not an immediate requirement. We're looking at Stripe for the payment gateway or maybe something like Chargify - still not decided. If you're interested in potentially developing something together and sharing the costs then please reply to discuss further. Rick.

In case anyone is in need of help on this, I solved my connection issue by changing my server name to "(localdb)\ProjectsV13":

&lt;add name=&quot;Default&quot; connectionString=&quot;Server=(localdb)\ProjectsV13; Database=FreightHub; Trusted_Connection=True;&quot; providerName=&quot;System.Data.SqlClient&quot; /&gt;

It's not ideal since VS2015 introduced non-versioned database connections, but helped me get started with the framework until I find the cause of the issue.

Can you please provide an example of how to do this for organization unit?

You may also like to add a unique index to the table on Name + EditionId + TenantId

Hi,

Thanks for your help. I can confirm that both of these issues are resolved.

#2 was because the database was refreshed and I forgot to set my time-zone again.

Regards, Sean

Okay great. Thanks for the quick reply!

<cite>exlnt: </cite> That file is already there. I updated the bundle reference to use "Darkblue" so that resolved the color issue. The menu still does not work. It will not expand when you click on it. Can you help me with that?

To fix this issue you need to edit YourApplication.Web>App>common>views>layout>sidebar.cshtml

You need to change this

<a href="javascript:;" class="auto" ng-if="childMenuItem.items.length">

To this

<a href="javascript:;" class="auto nav-link nav-toggle" ng-if="menuItem.items.length">

Hi,

It is related.

It is to do with the way you are registering the routes and the order that they are registered in.

The problem is that by adding a catch all route inside of the RouteConfig.cs of the web project. It gets registered BEFORE the dynamic API routes.

Here is how I resolved the issue.

Step 1: Add a catch all route in the PostInitialize method. This will ensure that it is registered AFTER all others.

public override void PostInitialize()
        {
            var server = HttpContext.Current.Server;
            var appFolders = IocManager.Resolve<AppFolders>();

            appFolders.SampleProfileImagesFolder = server.MapPath("~/Common/Images/SampleProfilePics");
            appFolders.TempFileDownloadFolder = server.MapPath("~/Temp/Downloads");
            appFolders.WebLogsFolder = server.MapPath("~/App_Data/Logs");
            
            try { DirectoryHelper.CreateIfNotExists(appFolders.TempFileDownloadFolder); } catch { }

            // Register catch all here
            RouteTable.Routes.MapRoute(
                "CatchAll",
                "{*urlString}",
                new { controller = "CatchAll", action = "Index" }
            );
        }

Step 2: Update RouteConfig.cs with the following. We need to comment out the default route, map attribute routes and add explicit routes for scripts and views controllers

public static class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            // Map attribute routes
            routes.MapMvcAttributeRoutes();

            //ASP.NET Web API Route Config
            routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
                );

            routes.MapRoute(
                "Home",
                "",
                new { controller = "Page", action = "Home" }
            );

            // Add explicit routes for some ABP controllers that were being handled by the now commented out default route
            routes.MapRoute(
                "AbpScripts",
                "AbpScripts/{action}",
                defaults: new { controller = "AbpScripts" },
                namespaces: new [] { "Abp.Web.Mvc.Controllers" }
            );

            routes.MapRoute(
                "AbpAppView",
                "AbpAppView/{action}",
                defaults: new { controller = "AbpAppView" },
                namespaces: new[] { "Abp.Web.Mvc.Controllers" }
            );

            // Comment out old default route in order to define explicit attribute routes
            //routes.MapRoute(
            //    name: "Default",
            //    url: "{controller}/{action}/{id}",
            //    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
            //    namespaces: new[] { "ProductsOnline.Web.Controllers" }
            //);
            
        }
    }

Step 3: Go through all Controllers and define explicit attribute routes as follows

[AbpMvcAuthorize]
    // Add explicit attribute routing
    [Route("profile/{action}/{id?}")]
    public class ProfileController : ProductsOnlineControllerBase
    {
Showing 1 to 10 of 12 entries