Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDEX VSIX for VS2015RC #598

Closed
roji opened this issue May 8, 2015 · 29 comments
Closed

DDEX VSIX for VS2015RC #598

roji opened this issue May 8, 2015 · 29 comments
Assignees

Comments

@roji
Copy link
Member

roji commented May 8, 2015

Hey @kenjiuno, with VS2015RC out maybe you'll have time to set up a VSIX for it?

@roji roji added the ddex label May 8, 2015
@kenjiuno
Copy link
Contributor

kenjiuno commented May 8, 2015

Hi.

I believe it will work on VS2015RC. Which Npgsql version: 2.2 or 3.0?

@roji
Copy link
Member Author

roji commented May 8, 2015

I haven't touched the DDEX provider at all for 3.0, so it should be really identical between the two...

@kmschaefer
Copy link

I got Visual Studio 2015 RC installed and tried getting version 3.0.0.0 working. When I tried to install the Visual Studio extension, it failed to install. Looking at the install log, it can't find an applicable version of Visual Studio. I don't know how to modify the DDEX provider configuration to force it to install.

5/8/2015 7:51:01 PM - Searching for applicable products...
5/8/2015 7:51:01 PM - Found installed product - Microsoft Visual Studio Professional 2015 RC
5/8/2015 7:51:01 PM - Found installed product - Microsoft Visual Studio Community 2015 RC
5/8/2015 7:51:01 PM - Found installed product - Microsoft Visual Studio 2015 RC Shell (Integrated)
5/8/2015 7:51:01 PM - Found installed product - Global Location
5/8/2015 7:51:01 PM - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.

@kenjiuno
Copy link
Contributor

kenjiuno commented May 9, 2015

Hi.

Ok, I will work it on this night... 12 hours later.

Kenji uno 🔰

2015/05/09 9:45、kmschaefer notifications@github.com のメッセージ:

I got Visual Studio 2015 RC installed and tried getting version 3.0.0.0 working. When I tried to install the Visual Studio extension, it failed to install. Looking at the install log, it can't find an applicable version of Visual Studio. I don't know how to modify the DDEX provider configuration to force it to install.

5/8/2015 7:51:01 PM - Searching for applicable products...
5/8/2015 7:51:01 PM - Found installed product - Microsoft Visual Studio Professional 2015 RC
5/8/2015 7:51:01 PM - Found installed product - Microsoft Visual Studio Community 2015 RC
5/8/2015 7:51:01 PM - Found installed product - Microsoft Visual Studio 2015 RC Shell (Integrated)
5/8/2015 7:51:01 PM - Found installed product - Global Location
5/8/2015 7:51:01 PM - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.


Reply to this email directly or view it on GitHub.

@roji
Copy link
Member Author

roji commented May 9, 2015

Thanks @kenjiuno :)

@kenjiuno
Copy link
Contributor

VS2015RC ddex support will take more times...

Sometimes ddex support will work, but sometimes it won't.

It needs some fixes.

For example, CreateObject will return AdoDotNetConnectionProperties instance for IVsDataConnectionProperties query.

    [Guid(GuidList.guidNpgsqlDdexProviderObjectFactoryString)]
    class NpgsqlProviderObjectFactory : DataProviderObjectFactory
    {
        public override object CreateObject(Type objType)
        {
            if (objType == typeof(IVsDataConnectionProperties) || objType == typeof(IVsDataConnectionUIProperties))
                return new AdoDotNetConnectionProperties();
            else if (objType == typeof(IVsDataConnectionSupport))
                return new AdoDotNetConnectionSupport();
            else if (objType == typeof(IVsDataObjectSupport))
                return new DataObjectSupport(this.GetType().Namespace + ".NpgsqlDataObjectSupport", System.Reflection.Assembly.GetExecutingAssembly());
            else if (objType == typeof(IVsDataViewSupport))
                return new DataViewSupport(this.GetType().Namespace + ".NpgsqlDataViewSupport", System.Reflection.Assembly.GetExecutingAssembly());
            return null;
        }
    }

But, AdoDotNetConnectionProperties doesn't implement IVsDataConnectionProperties.

It sometimes causes ServiceNotFoundException and such.

I'll report progress later.

@roji
Copy link
Member Author

roji commented May 11, 2015

Sure @kenjiuno, thanks for all the work :) We probably still have time for the final release of VS2015 anyway.

@kenjiuno
Copy link
Contributor

Hi.

I have noticed that some properties cannot be set values. This issue is seen on both Vs2013 and Vs2015.

failedsetval

The exception is thrown at Npgsql.NpgsqlConnectionStringBuilder.GetProperty(String keyword)

I don't really understand why setting property Buffer Size instead of BufferSize. hmm...

@roji
Copy link
Member Author

roji commented May 11, 2015

I'll try to take a look ASAP @kenjiuno

@roji
Copy link
Member Author

roji commented May 12, 2015

@kenjiuno, I don't understand exactly what's happening... The properties in NpgsqlConnectionStringBuilder have names like BufferSize, only the [DisplayName] attribute is "Buffer Size". AFAIK [DisplayName] is only for showing to the user, does VS try to call GetProperty with it somehow?

@kenjiuno
Copy link
Contributor

Thanks for checking it.

only the [DisplayName] attribute is "Buffer Size"

Yea, exactly.

does VS try to call GetProperty with it somehow?

I'll check the property name where it comes from.

@roji
Copy link
Member Author

roji commented May 12, 2015

OK @kenjiuno, let me know if I can help in any way. It's also strange because in 2.2 the connection string builder wasn't very different (properties had [Display] etc...)

@kenjiuno
Copy link
Contributor

Hi.

It seems to be by design...

AdoDotNetConnectionProperties.ToDisplayString() calls PropertyDescriptor.DisplayName to build connection string. (checked by ILSpy)

I have checked SqlConnectionStringBuilder's "Data Source" for example. http://referencesource.microsoft.com/#System.Data/System/Data/SqlClient/SqlConnectionStringBuilder.cs,399

I don't really understand the detail implementation, but DataSource property looks like just getter/setter for Data Source.

@roji
Copy link
Member Author

roji commented May 13, 2015

OK @kenjiuno, I'll take care of this in the connection string builder.

@kenjiuno
Copy link
Contributor

Hi.

Is it OK to use NpgsqlConnectionStringProperty as a workaround?

        /// <summary>
        /// Gets or sets the buffer size.
        /// </summary>
#if !DNXCORE50
        [Category("Advanced")]
        [DisplayName("Buffer Size")]
        [Description("Determines the size of the internal buffer Npgsql uses when reading or writing. Increasing may improve performance if transferring large values from the database.")]
        [DefaultValue(NpgsqlBuffer.DefaultBufferSize)]
#endif
        [NpgsqlConnectionStringProperty("Buffer Size")]
        public int BufferSize
        {
        ...
        }

This works well!

Also it needs TryGetValue I have written for 2.x @e70c665edbf7c5672d6f83282aeb69be22edabb6

ddex30props

EDM wizard also works well!

@roji
Copy link
Member Author

roji commented May 14, 2015

Great that it's working!

I'll make the change today to the behavior used by SqlClient, it should fix this issue. I'll also do TryGetValue.

roji added a commit that referenced this issue May 14, 2015
* Apparently the standard is for the CSB's [DisplayName] to be a valid keyword
  name (and even the canonical one). Made it so.
* Added missing TryGetValue

Thanks @kenjiuno

Relates to #598
@roji
Copy link
Member Author

roji commented May 14, 2015

OK @kenjiuno, I did these changes, the [DisplayName] attribute is now a valid keyword name (and even the canonical one)

Please test and let me know if anything else needs work!

@kenjiuno
Copy link
Contributor

Hi sorry for late reply.
I'll test this, thanks!

@kenjiuno
Copy link
Contributor

Ok, Npgsql 3.0.0 develop ddex works on VS2013: both EFv5 and EFv6 projects.

@roji
Copy link
Member Author

roji commented May 23, 2015

Great work @kenjiuno!

I plan to release 3.0.0-beta1 at some point this week, it would be great to release the DDEX VSIX after it. I'll drop you a note when I release.

@franciscojunior
Copy link
Member

Excellent work, @kenjiuno!!

@JanRou
Copy link

JanRou commented May 25, 2015

I have successfully got Entity Framework 6.1.1 up in VS2015 Community RC. The first attempt failed with Entity Framework 6.1.3. I have followed the Visual Studio Design Time Support DDEX Provider procedure.

I have installed:

  • VS2015 Community RC - no other Visual Studio is installed.
  • VS2015 RC SDK
  • Setup_Npgsql-2.2.5.0-net45-r3
  • PostgresSQL 9.4 64 bit version

I have created the test console project following the procedure and installed the NuGet packages:

  • Npgsql version 2.2.5.0
  • Npgsql 2.2.5.0 for Entity Framework >6.0.0
  • Entity Framework 6.1.1 (don't use version 6.1.3, because it fails)

Voila the database model appears.

@Emill
Copy link
Contributor

Emill commented May 25, 2015

Maybe silly question, but have you built your project once?

@JanRou
Copy link

JanRou commented Jun 27, 2015

Yes. I'm looking forward for support of 6.1.3 and especially code first support, which will position Postgres as and complete equivalent and better choice than MS-SQL. You will get database partitioning and ORM for free.

@roji
Copy link
Member Author

roji commented Jul 11, 2015

@kenjiuno, I'm not sure anymore but does the DDEX provider support VS2015? Above we discussed Npgsql 3.0 support more than VS2015... I'm asking because the official release is expected to be July 20th.

@kenjiuno
Copy link
Contributor

Hi.

Sorry for long blank.
I'm working on issue #622 : the possibility of non-GAC VSIX installation. There are at least 2 problems to be researched. It will take more than a week...

I'm asking because the official release is expected to be July 20th.

Wow it is almost near future!

Anyway, the most sure way is to do Npgsql GAC installation for DDEX support, for now.
However, I think that incoming Npgsql 3.0 and its EF support DLLs are distributed by NuGet or similar online distribution service.
How about this?

In this situation, I will be able to prepare following things for now:

@roji
Copy link
Member Author

roji commented Jul 12, 2015

Hey @kenjiuno.

Ah, I didn't know you were working on non-GAC VSIX installation, that's great.

I think that for now there's now urgent need to change how the DDEX provider works - only to make it compatible with VS2015.

For 3.0, it would be great if we could have a simple, clean VSIX that doesn't do anything with the GAC. An actual release of 3.0 is probably 2 weeks away (if nothing serious is reported), so you have time to work on that if you want. If you don't have the time to do it for the 3.0 release, we can always release the DDEX provider a bit later, I don't think it's a big deal...

@kenjiuno
Copy link
Contributor

@roji thanks, I'll try non-GAC version!

@roji
Copy link
Member Author

roji commented May 8, 2016

Closing this as we have DDEX for VS2015 with Npgsql 3.0.x.

Work on a non-GAC VSIX DDEX extension can be tracked in #622.

@roji roji closed this as completed May 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants