Iam getting following error when iam using 'System.Net.HttpStatusCode' in my wcf project.
The type 'System.Net.HttpStatusCode' exists in both 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll' and 'D:\HKMP\Branch\NewAmelio\amelioSL\Web\Services\bin\System.Net.dll'
HttpResponseMessageProperty property = new HttpResponseMessageProperty();
// Here the response code is changed to 200.
property.StatusCode = System.Net.HttpStatusCode.OK;
In your Visual Studio project do you have the reference to System.Net.dll marked as "Copy Local"? Select the reference in Solution Explorer and then press F4 to open the property grid. You'll want to make sure that Copy Local is set to "false" because this reference is already available on every computer with the .NET Framework installed.
You'll then also want to delete any copy of System.Net.dll that you have in your project folder as well as delete it from source control.
Related
When trying to add a Content Page to the solution in visual studio, the following error occurs:
Exception of type 'System.Exception' was thrown.
The project system has encountered an error.
Did not find new element in the hierarchy for item `Views\MyPage.xaml`.
The item would have been added with type "Page".
The project item schema service knows about this item type.
The item does exist in the project file.
When adding the file I do the following:
Right click on Views in my Xamarin Solution > Add > New Item > Content Page > Add
When looking in the windows explorer, there is a file created MyPage.xaml but it has not created MyPage.xaml.cs and it is not added to the solution
It is a blank Xamarin shared project and this error just keeps happening...
It's driving me nuts as I can't even add a single page
As a workaround, I add the files manually using the W. explorer and then edit app.projitems manually, but this is just ridiculous.
As a dirty workaround until this gets fixed, adding the files "manually" to the project gets the job done.
With Visual Studio closed,
copy/paste existing (working) *.xaml and *.xaml.cs files (rename
them as you please)
open the newly pasted files with a text
editor (not VS) and rename the contents to your chosen name in #1
add newly pasted files to your *.projitems file (open it in a text
editor, search for the filenames you copied in #1 and add the new
ones similarly) - there'll be 3 places to add them
Now open the solution in VS and rebuild - it should look and build fine.
Apparently, if you go into the VS2017 installer and install the Universal Windows Platform (UWP) development workload, this fixes the issue.
Make sure you have
StackLayout
instead of
ContentPage.Content
in your .xaml files that throw this exception on VS.
Hi I have Visual Studio 2015 - And when I try to create a new Windows Form Application - both the Location, SolutionName, CreateDirectoryforSolution box and Add to Source Control are missing - Yet if I select a "Telerik" type or other types it shows - I've checked on my colleagues machine and his works as predicted. ie Shows the other project elements.
Two images below - Any clues? Resizing the frame does not help.
Thanks
and with the correct details:-
Visual Studio allows you to create new projects without having to save them (temporary projects).
If you create a new Forms application, it will generate all the files etc. If you wish to save, click the Save menu option and the following window is shown:
You can control this behaviour via the options:
On the Tools menu, click Options.
Expand the Projects and Solutions node, and select the General node.
Make sure Save new projects when created is cleared, if you want to allow temporary projects; otherwise, make sure it's checked to be prompted for location and solution name when creating a new project.
Click OK.
With the Save new projects option is checked, you'll be prompted for a Name, Location and Solution Name when selecting the project type, as per the screenshot below.
This MSDN article: Temporary Projects provides a fuller explanation on the subject.
I create a new solution and add some projects to it via the Solution2.AddFromTemplate. Now before I can build my solution successfully, I need to add a project reference from one of the projects to the other. I'm trying to navigate the VS automation object model, but cannot find how to do this.
I realize that I could just open the csproj as XML and change it on disk (as suggested here), but then I need to handle Visual Studio detecting the project file changing and prompting to reload it.
Anyone know how to do this or point me in the right direction?
Found the answer, posting for future reference.
The trick is to cast the Object property of the EnvDTE.Project to VSProject and then call AddProject on its References property.
var targetProject = (VSProject) _project.Object;
targetProject.References.AddProject(sourceProject);
I get this on my work machine (Win7 64bit), and this happens every time I open VS2010, and this is what I've done so far:
1. set folder properties (projects, project templates and item templates) from Import & export settings.
2. set projects, project templates and item templates paths from Options/Projects & Solutions.
3. found and manually set registry value that points to the above properties.
so every time I close VS 2010, nothing seems to save and I get the above error again and I find all values that I have set back to where it was.
I began getting this error after installing TFS Power Tools, and it looked to be related to that rather than to VS2010 itself.
I fixed it by going to Tools->Options, expanding Team Foundation Server Power Tools, clicking Work Item Template, and setting the default template store path to a path of my choice.
Once I saved that the message went away and I was able to start up my IDE unharassed.
Our BizTalk Server got renamed, but when we create a new project it still keeps defaulting to the previous server. I have been looking but I can't find anywhere to set these default values and update it.
edit:
Since it might be more clear if I add an image, I did.
Basically now when a new project is created the Server in the below screen is BizTalkDev_1. Can we change this to always be localhost when we create a new project? A hidden ini file somewhere?
When you go to visual studio project. Right click the project ...go to the property...and in the deployment part you can change the server name ...