Is it impossible to test Silverlight inside Visual Studio when calling Webclient? - visual-studio

Since it generates a security exception How do I load an xml file in XDocument in Silverlight?, does it mean it's impossible to test Silverlight on Visual Studio when calling Webclient ?
I want to call a Rest webservice which returns XML from a PHP or Java server not a Microsoft webservice.
My question is about inside Visual Studio not after putting the code on IIS. The Knowledge base above does only tell how for IIS not for Visual Studio localhost.

Related

Is it possible to publish a .NET Core console application over FTP in Visual Studio 2019?

My question is nearly identical to this How to publish ASP.NET Core app to ftp server with the exception my question is .NET (where as the linked question is for ASP.NET).
However, I think I can follow the instructions on that link. I click Publish, and choose Import Profile and I import the following
<?xml version="1.0" encoding="utf-8"?>
<publishData>
<publishProfile profileName="FTP" publishMethod="FTP" publishUrl="ftp://ftp.domain.co.uk/project/" userName="user" userPWD="***" destinationAppUrl="http://www.domain.co.uk/Software/project/" />
</publishData>
When I do this and click I finish, I see
Object reference not set to an instance of an object
This used to be very simple with .net framework and click once.
Is it possible to publish a .NET Core console application over FTP in Visual Studio 2019?

consuming service reference typescript

How to consume service reference in Typescript HTML App using Visual Studio 2013.
I have added a service reference to my typescript HTML app. but don't know how to call service client in typescript code.
Typescript HTML App template in VS 2013 uses C# project type as wrapper. That means you can add Service Reference in UI. But there is no built in support to consume such reference in TypeScript - there is no service client unless you implement it.

Cannot Import Asmx web service reference in vs 2010

I have web site built in visual studio 2008 using .net framework 3.5.Now i want to migrate the web site code to visual studio 2010 but want to keep the target framework to same i.e 3.5. The web site is built using vb.Net.MY problem is when i am importing the reference of web service in visual studio 2010 it show error as "NameSpace or type specified in imports 'WebReference' does not contain any public methods".My service name is "WebReference" . I thought may be .net has built in System.web.services.Description.Webreference ,may be it shows conflict ,so i tried to rename it to "WebReference1" or some other name but it does not have any effect,yhe error is still there.What am i missing?
probably it is because you cannot use importer :
ServiceDescriptionImporter importer = new ServiceDescriptionImporter();
in vs 2010....you need vs 2012 because that only has support for .net framework 4.5 which in turn has assembly references to ServiceDescriptionImporter .

Developing in Visual Studio 2010 and Sharepoint 2007. Using new SPSite throws errors

I'm re-writing a console application using Visual Studio 2010. The original application was written using Visual Studio 2008 and works OK, but has no tests associated with it. Hence, the idea of re-writing it with tests.
Both applications are working with a Sharepoint 2007 site.
The project compiles but when I try and run it the code below is throwing errors.
SPSite spsite = null;
SPSecurity.RunWithElevatedPrivileges(delegate() {
spsite = new SPSite("http://sharepointdev");
});
return spsite;
I'm running this on Windows Server 2008. I've set the platform target of the build to be x86 (this is in the properties of my project) and in Security I've checked that this is a full trust application. I'm also running the project as an administrator. I've also set the .NET Framework to be 3.5
Is it just a case that SharePoint 2007 just doesn't want to play with Visual Studio 2010, or is there something else I've not yet considered?
I've tried searching on the web and stackoverflow but all the articles I've seen deal with trying to get Visual Studio 2010 to work with Sharepoint 2010.
The exact error I get is 'Object reference not set to an instant of an object' with the debugger high-lighting the SPSecurity call.
If I just use this code
using(SPSite spsite = new SPSite("http://sharepointdev")){
Then I get a FileNotFoundException, which isn't exactly true! I've got plenty of applications that do find a site using that URL. What I suspect the error message is trying to say is that my 2010 application is not being allowed to access the site, but I've not found any clues as to why that should be.
Any clues, hints or suggestions gratefully accepted.
EDIT
I've lifted the code from my VS 2010 project and dropped it into a new VS 2008 project and it ran straight-away.
FURTHER EDIT
I created a simple little console application in VS 2010. By default it uses .NET Framework 4, I had to set this to .NET Framework 3.5. I also set the platform target to be 'Any CPU' and it works. This makes me wonder if there is an issue with the Test Project associated with my first application?
I re-created the console application but this time without a Test Project associated with it (the test project was a class library and worked with NUnit). It ran with no problems. I guess the problem lies within the test project and something there that the solution doesn't like. Probably there's a build there it doesn't like
TL;DR; answer: Switch to Any CPU build - don't choose x86.
I've run into this problem before with a console utility. I got the same FileNotFound error but it's referring to the DLL, not your SharePoint site. Digging a bit I discovered a deeper error of BadImageFormat and realized it was complaining about a DLL or EXE. I guessed it was due to the linking from x86 to MSIL. There's a lot of things that have to happen to marshal calls between the two and I guess it led to an incompatibility. When I switched it (and verified all my support library projects) built to MSIL/Any CPU the application worked with no problems and no other changes.
I use Visual Studio 2010 to develop for SharePoint 2007 all day for a long time now and the only problems I've encountered aren't related to that combination. More often than not it's a quirk of a 3rd party add-on I'm using. For almost all of my development I start with the WSP Builder templates but they are buggy and have a few quirks you have to work around (some severe enough to take down your SharePoint server) so I don't blame VS 2010 directly.

Alternatives to Using BuildProviders with Web Applications

I've read that you cannot use a BuildProvider with Web Applications in Visual Studio (or more specifically, you can use it, but your code isn't part of the project)
Are there any other ways to generate code on the fly using a Web Application project?
With or without using third-party tools?
Have you tried T4 templates in Visual Studio?

Resources