开发者

Debugging Silverlight project with Visual Studio loads file not local webserver?

开发者 https://www.devze.com 2023-02-05 04:58 出处:网络
I\'ve got a Silverlight project in VS 2010 that when I go to debug, my browser is spawned, but the file:// location is attempted, rather than loading the http://localhost location.

I've got a Silverlight project in VS 2010 that when I go to debug, my browser is spawned, but the file:// location is attempted, rather than loading the http://localhost location.

How can this be fixed?

Thanks.

-- Update --

The specific error is as follows:

The provided URI scheme 'file' is invalid; expected 'http'. Parameter name: via

The error makes sense, but the reason why it's trying to load up file: rather than spawn the local serve开发者_如何学Pythonr is the issue.


First, you'll need to have a web project to host the silverlight app. Second, edit your web application properties (select the project then press ALT + Enter) and add a reference to your silverlight application in the "Silverlight" tab. Now whenever you build your applications, a copy of the silverlight app will be copied to the web application.

After that, create a test page with some HTML and add an object tag with the url to the silverlight xap file.

Also, make sure your web application is set as the default startup application.

0

精彩评论

暂无评论...
验证码 换一张
取 消