Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
0
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
Add comment
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

· Add your reply
  • Sort: 
avatar image
0

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
Add comment · 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

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

how can i get my game embedded on my website? 2 Answers

embedding light html5 project in an email 0 Answers

Embedding Unity3D into a Java application 0 Answers

Embedded app in unity 0 Answers

Can I pass in the base path / asset path when embedding Unity content in a webpage? 1 Answer


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