I have converted a VS2005 solution to VS2008 solution.
I am trying to Add a Service Reference to a project in the solution but not finding the desired option in the Right click -> Popup Menu.
I am not trying to add a Web Reference. I am trying to add a Service Reference. I am working with a WCF Client.
Check if the Project (Project-->Properties) is set to Target Framework ".NET Framework 3.0" or ".NET Framework 3.5".
Maybe it isnĀ“t changed during conversion from VS 2005 to VS 2008
Do you mean the "Add Web Reference" option, like in VS2005?
You need to right-click your project, select "Add Service Reference", then click the "Advanced" button in the bottom-left of the popup window, and then click the "Add Web Reference" button in the bottom-left of the next popup window.
From what I can tell, the project must be either a C# or VB project in order for the Add Service Reference option to be available. If you add a CLR-enabled C++ project, you'll have access to the Add Web Reference option, but not the Add Service Reference option. If the C++ project is not CLR-enabled, then neither of these options are available. Can you confirm what type of project you're using?
Related
I want to store startup settings for my project. When I go to the project Properties/Settings, it's empty except for a link that says, "This project does not have a default settings file. Click here to create one." When I click the link to add one, it says "The system cannot find the file specified. (Exception from HRESULT: 0x80070002." So, how do I add a default settings file?
As mentioned in my comments, this seems to be a bug in VS and ought to be reported to Microsoft. As a temporary workaround, you can actually copy the settings files from a .NET Framework project into a .NET Core project. As far as I can tell from examining various VB and C# projects targeting .NET Framework and .NET Core, the settings files are the same in each case, so there's no issue copying between them. Here's what I did:
Added a VB WinForms app project targeting .NET Framework to the same solution.
Clicked the Show All Files button in the Solution Explorer for both projects.
Expanded the My Project node for both projects.
Dragged the Settings.settings item from the .NET Framework project to the .NET Core project.
It seemed to work as expected after that.
I've created a Xamarin project which added the following projects to the solution:
Xamarin.UI(Portable)
Xamarin.UI.Droid
Xamarin.UI.iOS
Xamarin.UI.UWP
Xamarin.UI.Windows (Windows 8.1)
Xamarin.UI.WindowsPhone (Windows Phone 8.1)
I am having problems creating a client which can consume my WCF service.
1) Firstly the current Xamarin project template doesn't reference System.ServiceModel assembly in the PCL therefore I cannot right click the PCL and Add Service Reference to my project. When I manually add a reference to System.ServiceModel from this location - C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5 the menu item for create service reference pops up. When I click Go in the Add Service Reference dialog I get the following error:
"This service cannot be consumed by the current project. Please check if the project target framework supports this service type."
The PCL targets are as follows:
.NET Framework 4.5
ASP.NET Core 1.0
Windows 8
Windows Phone 8.1
Xamarin.Android
Xamarin.iOS
Xamarin.iOS
I don't know how to get this working ?
2) Secondly the work around I use is to create the client with SlSvcUtil.exe
Add the generated code to my PCL along with a reference to System.ServiceModel and everything builds ok. The problem is that when I run the code it flags up type reference errors ! Should I be manually adding the reference to System.ServiceModel anyway? What am I doing wrong in this scenario? Am I missing some steps?
I've checked the Xamarin docs but it seems that I can't find detailed instructions on this.
Please help me out ! Thanks:)
PCL and WCF should be supported. Alternatively, you could get this to work manually with HttpClient, etc. But maybe if you can use the shared project instead of PCL, that would be easier. Otherwise you'd have to also use DependencyService, create interfaces, etc. for each platform.
I want to create a winform/console application inside visual c# that uses class library project from visual web developer, how do I do that?
Thanks
Right-click on the references folder in the Solution Explorer pane
Click Add Reference in the menu that appears
Select the Browse tab
Browse to the file you'd like to include
Click OK
You're done! The file has been added to your references.
I created a VB Console app and it defaulted to .NET 4 but I need it to be .NET 3.5. I've been looking but all the references I find say to change it on the 'Compile' tab in properties but I don't have a compile tab or anything else that lets me change the target framework.
Any ideas other than recreating the project?
Note: I'm using VS2010 Ultimate
Update: added screen shot
Are you sure you are right clicking the project, then clicking Properties? For me in the properties window there is a Compile tab on the left side (under Application), and there is an option to change the target under Advanced Compile Options....
In vs2010 you goto PROJECT ---> SLN Name properties --> COMPILE ---> ADVANCED COMPILE OPTIONS(BOTTOM). Now Reverting it to 3.5 is something that as far as I know is something you can't do, atleast not easily or advised. Obviously upgrading from say a 2.0 to a 3.5 or 4.0 framework is easy as the step's above. Your best bet is unfortunately to create a new project in the 3.5 framework.
Project/Properties/Compile/Advanced Compile Options
My website is VB.NET 2.0. I already opened a it in VS2k8 and told it not to upgrade. Now I want to upgrade, how do I trigger it? All the posts say 'just open it in 2k8 and it will prompt you'. Well I did, and it did, and I didn't want to yet. Now I cant get it to come up.
Open your project properties and choose Target Framework in the Application tab. There should be values such as ".NET Framework 3.5", ".NET Framework 2.0", etc. You can access project properties in your Solution Explorer by right-clicking on your project name and choosing Properties from the right-click menu.
If Solution Explorer isn't showing for you in Visual Studio, you can access it via the View menu > Solution Explorer.