Update service reference error "interface not supported" - wcf

I added a field to a table in the SQL Server database of a web site.
The web site works well.
Now I need to update the service reference of a WCF utility that communicates with the website.
In Solution Explorer (Visual Studio 2019) I go in the "Service references" of the project, there is only ONE element, I right-click over, appears the context menu, I select "Update ..." and I obtain an error: "Interface not supported" with no explanations.
And the WCF application of course fails communicating with the web site.
I'm completely ignorant abot WCF, all the code was written by another developer now "gone".
Any suggestion?

You updated the fields in the database, but did you use the table in the wcf code? If you do, you need to make changes accordingly. When you are done, right-click the service reference you want to update in the Connect Service options and click Update Service Reference.
If this update doesn't work, you may refer to this article to cut out the service. Model section of web.config and update the Service reference.
If all else fails, remove the service reference and add it again. Of course, back up your code when you do this.

Related

Visual Studio LightSwitch HTML project will not deploy database schema to Azure SQL Database

I ran into deployment issues, so I created a test app to prove out the deployment process. I've kept everything as "out of the box" as possible:
I've created a simple (one table and one screen) VS2013 LightSwitch HTML client app, but the deployment fails, because it will not deploy the database schema.
I've created the Azure website and linked it to my Azure SQL Database, also the "Deploy database schema" checkbox is checked in the wizard.
It seems that my only option at the moment is to manually create the DB objects, which seems kind of absurd.
I have found a workaround to this issue.
It seems that the problem stems from not having the deployment credentials. What I have found is that if I attempt to deploy the server project there is a drop down list box that's supposed to be populated with available destinations. At the first attempt the list comes up blank but if I proceed to publish a message flashes up confirming a new set of credentials has been downloaded. After that I found I am able to publish the main project itself database objects as well.
In short; make sure you are properly logged in even if you have to log out and then in again, and also have deployment credentials up to date.

Deploy WCF service to another Sharepoint server

I've created a WCF service in Sharepoint 2013 and it works great on our dev server. However, we now need to push it onto a production server and I can't seem to find any instructions on how to publish to another server.
I followed a tutorial very similar to this one:
http://www.robertseso.com/2013/05/adding-custom-wcf-services-to.html
In development, but it doesn't cover actual deployment. As per this (and other) tutorials, I deployed as a "farm" solution. If I go to "publish" in Visual Studio the option to "Pubish to SharePoint Site (Sandboxed solutions only)" is grayed out.
After a lot of searching around, I was able to piece together an answer. So in case anybody else encounters the same problem:
In Visual Studio, when you go to "Build" and "Publish..." you can "Publish to File System" (the Publish to SharePoint Site being grayed out as noted in the question). What this does is produce a .wsp file that is you packaged install file you need.
Transfer this file to your target SharePoint server and then open SharePoint Management Shell (as administrator). A list of available cmdlets can be found here:
http://technet.microsoft.com/en-us/library/ff678226%28v=office.15%29.aspx
I used:
Add-SPSolution -LiteralPath c:\<path to wsp file>\myservice.wsp
This adds the solution to Sharepoint but doesn't install it. To install you need:
Install-SPSolution -Identity myservice.wsp -GACDeployment
Note, however, that this will give you an error if the Sharepoint Administrator service isn't running (so check in services.msc first)
This add the installation job to a timer to be run at some point. You can check the status with:
GetSPSolution
Which will list all the solutions, or you can pass a name to if you want to only see the one you just installed. This will show you the "Deployed" status of the service. In my case, it was stuck of False and even after several minutes refused to do anything.
In my case, this problem was solved by going back into services and restarting both SharePoint Timer Service and SharePoint Adminstrator after which is magically showed deployed as True.

Recommended use of <identity impersonate="true"/> breaks application

Get Current Windows User VB.net
Forgive this .NET rookie, for I know not the complexity of the application I am trying to support or the detailed workings of Windows Authentication.
The application I'm attempting to modify is a combination of an Excel Add-In and a Dynamics GP Web Service extension. I am attempting to add a simple line of code to the WS extension that sets the current windows user to a variable. Like the person in the linked question, I am getting NT AUTHORITY\NETWORK SERVICE and instead need to get the true windows user.
I came upon the Q&A in the above link. However, adding the line to the WS extension web.config file breaks the application I'm working with. I receive an error beginning with "Client found response content type [...]" which continues below the viewable portion of the screen with no ability to scroll so I don't know if there is useful content further down.
I also have tried setting my variable to Environ("USERNAME") but that sets it to "ROGUE$" - ROGUE is my computer name. I am expecting a successful effort to result in my variable equal to "Administrator" as that is who I am on the virtual machine I'm testing on.
If you want to run an ASP.NET application in the context of a Windows user then you will need to use Windows authentication or change the identity which the application pool uses. This article: http://www.wrox.com/WileyCDA/Section/ASP-NET-3-5-Windows-Based-Authentication.id-310905.html looks to have the information you need for the former.
Do consider the security implications of doing that. It may be better to change permissions such that the NT AUTHORITY\NETWORK SERVICE user is allowed to do what is required and no more.
Further reading:
Configuring ASP.NET Process Identity
Application Pool Identities

How to build vb.net application so that database is easily connected when published?

I've made VB.NET application in VS2010 that uses a 2007 Access database, called MenuDB.mdb. During development, everything was fine.
Now that I'm publishing it, I'm getting weird errors because for some reason the app isn't connecting to the database.
I install the application and run it but as soon as it opens it gives this error:
System.Data.OleDb.OleDbException (0x80004005): Could not find file
'C:\Users\Administrator\AppData\Local\Apps\2.0\Data\OV86PXJA.K3R\8575R5AY.95Z\menu..tion_0d4fa454d69e8e6b_0001.0000_8340d263807cbb71\Data\MenuDB.accdb'.
I know the problem has to do with the way I'm relating the application to the database, but I don't know which way is right. In Solution Explorer I changed the Build Type of MenuDB.accdb to "Content" (earlier it was embedded resource". But it doesn't work either way. In my App.config I have the following connection string:
connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\MenuDB.accdb"
I want that when I deploy the application, the database should just sit in the application folder, wherever it gets installed. How can I do that?
Edit
I don't mind deploying it in such a way that I need to paste the database somewhere myself on the target machine - as long as it works.
If you have multiple users using the same or similar database, and dont have access to a SQL server (MySQL, MSSQL, or others), then co-locate the database at a central location (preferably network location) that all the users will have access to and change the connection string to accomidate the database location being on the network.
Just let it be known, Access can handle up to 10users when doing simple data retrieval/submission but if you ever have it open while others are accessing via data objects, then you may lock them out.

Verify that the current user is granted access in the appropriate allowedAccounts section of SMSvcHost.exe.config

I have getting the above error when i try to start wcf service hosted in windows service. i am using net.tcp binding with port sharing and have updated the SMSSvcHost.exe.config with the correct SID. What else I could be missing which is casuing this error
i noticed on other forums people suggsting rebooting the server and running the service under admin account. don't know how relevant these suggestions are.
the issue was casued by installtion of .NET Framework 4.0. It upgared net.tcp port sharing as well.
I ran into the same issue. My solution is grant Administrative right to the application by adding app.manifest file and use this file in the project properties, manifest field. If I am running in Visual Studio, I need to run VS in administrative mode.
That is kind of sucks. I am wondering others have a different solution to this.
Running Visual Studio as Administrator worked for me