How to create XBAP from VS 2012
Asked Answered
S

1

6

I thought that creating my application with WPF and XAML would make it more portable, maybe even executable over the web, but I'm having trouble figuring out how this works with VS 2012. The resources I'm looking at are saying that I need to create a XBAP, which should be an option when creating a new project in VS 2010. But my choices for a new C# application in VS 2012 are:

  • Windows Forms Application
  • WPF Application
  • Console Application
  • Class Library

I created my application as a WPF application, and switched it to target .NET 3.5 client profile so as to be more backward compatible. But whether my application is embedded in a ZIP file or provided as a straight EXE, both Chrome and IE 9 report that it is likely malicious. I don't remember ever getting such alarming warnings even on pre-.NET executables before. Why the sudden alarmist response from the browser on an application that is supposed to be able to run in a sand-boxed safer environment no less?

I have tried Signing the assembly and providing a ClickOnce installer and signing the ClickOnce manifest. This allows it to run a bit more nicely in IE, but not in Chrome.

I tried switching the project security settings to "This is a partial trust application", but that yields the error "That assembly does not allow partially trusted callers." And when I add [assembly: System.Security.AllowPartiallyTrustedCallers] to AssemblyInfo.cs, then I get an error trying to load PresentationFramework.dll: "Request for the permission of type 'System.Security.Permissions.UIPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."

What happened to XBAP? Can VS 2012 Express not create browser applications?

Spectacled answered 30/12, 2012 at 13:22 Comment(4)
XBAP is not the right approach if you need to create a consumer application. I don´t know if this is your case.Southwestwardly
@HighCore It started out as a project I just wanted to share with family to play a game remotely, but I want it to be a little less alarming when it comes time to download/install/run the application. That's the core of my question. What's the right way to make a free simple "toy" project safe to run and download assuming it doesn't need to modify any files or save any data, just present an interactive UI and connect to other network clients via sockets (UDP)? Could you explain what the ideal answer for this is, and why XBAP is or is not it? (Keeping in mind C# is my preferred language.)Spectacled
XBAP is intended for intranet scenarios. It has been disabled in the default settings of IE9 for the Internet Zone. See this. If you need a way to deploy your WPF application to other people, I would suggest creating a ClickOnce deployment, and a full blown regular WPF application instead of an XBAP (which is basically the same, but with less security restrictions)Southwestwardly
So there is no free way to download or run .NET code in a sandbox to make it "safer" in the eyes of a browser so the browser doesn't give such alarming messages? The messages from a ClickOnce installer are less alarming than the messages from downloading a zip file, but it only works with IE. Surely there are sites that provide programs for download that don't present such alarming messages. For example, when I download from sourceforge.net/projects/sgdk2/files/latest/download I don't get alarming messages like I do from enigmadream.com/fangsatz/Fangsatz.zip. Why "Malicious"?Spectacled
H
0

Project name is WPF browser application

Herbertherbicide answered 23/1, 2014 at 10:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.