Base solution for your next web application

Activities of "boeseb"

No i refer to the dialog for publishing the page to a server.

If i publish the Abp project i don't get the option "Execute Code First Migrations" so i guessed VS cant do this if the DatabaseContext is in a library and not in the main project. In a text about deployment via web publish it says: "This check box is shown for databases that the application accesses by using an Entity Framework Code First context class. " But i am not sure if this is the case in ABP or if there is the possiblity to change it in a way to get the migration to work like this.

I will lookup the command line tool.

Thanks again for your great support

Thanks for your answer and hard work on ABP.

I added the reference in the main project now, but I am afraid i have another problem with deployment. Is there a way to get the migration of the database working with webdeploy? Currently i only get the databasescheme from my local test db copied to the target db. I would like to run the migrations on the server so the initial data from migration is also filled in the servers db. Is this another problem with VS that i dont get the option "Apply Migration" if its not in the main project?

With kind Regards, Sebastian

Also my other problem is solved now. It had to do with the custom DependencyResolver. After setting it in my HubConfig getting a valid ConnectionManager from GlobalHost failed. So i got a not working HubContext. Setting the custom DependencyResolver in GlobalHost.DependencyResolver instead of only in the Hub Configuration fixed the problem. See [http://stackoverflow.com/a/31315380/4369295]) for code.

Thanks for the hint to the ContractResolver. I found following article that shows how to add a ContractResolver to SignalR

EDIT: I found this code but am not sure where i need to register the Serializer into the IoC container

using System;
using System.Reflection;
using Newtonsoft.Json.Serialization;
using SignalR;

namespace Loveboat.Configuration
{
    public class SignalRContractResolver : IContractResolver
    {
        private readonly Assembly _assembly;
        private readonly IContractResolver _camelCaseContractResolver;
        private readonly IContractResolver _defaultContractSerializer;

        public SignalRContractResolver()
        {
            _defaultContractSerializer = new DefaultContractResolver();
            _camelCaseContractResolver = new CamelCasePropertyNamesContractResolver();
            _assembly = typeof (Connection).Assembly;
        }

        #region IContractResolver Members

        public JsonContract ResolveContract(Type type)
        {
            if (type.Assembly.Equals(_assembly))
                return _defaultContractSerializer.ResolveContract(type);

            return _camelCaseContractResolver.ResolveContract(type);
        }

        #endregion
    }
}

And added this to the AbpModule Initialize Method:

var serializersettings = new JsonSerializerSettings {
                ContractResolver = new SignalRContractResolver()
            };

            var serializer = JsonSerializer.Create(serializersettings);
            IocManager.IocContainer.Register(Component.For<JsonSerializer>().Instance(serializer));

It works, but is there a better way to solve it?

Thanks for your fast response.

While trying to fix the problem i noticed some other issue with the serialization of objects from the AppService and the Serialization signalR is doing.

In serialized objects from AppService all properties of the serialized object start with a lower case letter in the javascript object. The same object sent via SignalR however has properties starting with a upper case letter. This difference is breaking my knockout bindings.

Is there a way to fix this?

Showing 1 to 5 of 5 entries