• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by CHPedersen · Mar 04, 2011 at 08:25 AM · embedmime

Unity embedded in ASP.Net (ASPX)

Hey all,

First off, really sorry about the length of this, but I felt it needed some explaining...

I ran into some peculiar behavior yesterday when I was deploying my unity web app. I'm actually a .Net-programmer, so I thought I'd embed the unity content into an ASPX-site so that I'd be in a familiar environment when the time came to develop the website surrounding the Unity application. I got the IT department to create a brand new, clean Windows Server 2008 R2 with the usual roles - ASP.Net, .Net 4.0, etc.

I then proceeded to create a sample ASP.Net site, uploaded it, it worked. I then embedded the .unity3d-file into the ASPX-file using the HTML code provided in the HTML file Unity automatically creates when you build a web app. And there's where the problem started.

It works locally, but not on the server. When I load the site with the unity content from the server, the progress bar never loads, and in Firefox, all I see is the logo. In IE, I got an "Invalid data file" error. At this point, I know what you're thinking - But it's not a missing MIME-type in IIS7. I googled that for ages yesterday, and already followed those instructions: I've tried to add ".unity3d" and "application/vnd.unity" first as staticContent in my Web.config and second on the IIS itself, and then when that didn't work, in the opposite order. When I was just about running out of ideas, I tried uploading the HTML file Unity creates instead of the ASPX-site I'd ported the code to and that worked, both locally and on the server.

The funny thing is, after I'd had the server serve the Unity content through the HTML-file once, the ASPX-site started working on its own. That, I really REALLY don't understand.

Anyone got an idea what happened in the meantime? What did the HTML file do to the server that caused it to suddenly start serving .unity3d-files through ASPX, when it wouldn't before in spite of the MIME-type being present?

Comment

People who like this

0 Show 0
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image

Answer by Gamegineer · Sep 03, 2013 at 10:52 PM

Worked first time using "application/octet-stream" instead of vnd.unity

web.config:

 <configuration>
  <system.webServer>
    <staticContent>
      <mimeMap fileExtension=".unity3d" mimeType="application/octet-stream" />
    </staticContent>
  </system.webServer>
 </configuration>
Comment

People who like this

0 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

embed web player without javascript 1 Answer

How can i lock size unity scene after PC standalone build. 0 Answers

Google Maps in Unity!!! 1 Answer

embed unity into native android app 0 Answers

Embed Web Browser into unity 4 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges