title: .NET MVC how to get URL of embedded resource from another assembly
body: <p>I am trying to get the URL of some resources I embedded in a class library I made.  There is one javascript and one css resource.  I need to be able to add these to specific razor views so that is where I'd like to access them.  If I can just get the correct URL for these resources then I should be fine.</p>
  
  <p>I'm using MVC .Net Framework 4.5.2</p>
  
  <p><strong>What I've Tried</strong></p>
  
  <p><strong><em>1</em></strong></p>
  
  <pre><code>&lt;script type="text/javascript" src="Default.Namespace.javascript.jsFile.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>result:</p>
  
  <p>Unable to find file at the specified location <code>http://localhost:12345/Default.Namespace.javascript.jsFile.js</code></p>
  
  <p><strong><em>2</em></strong></p>
  
  <pre><code>&lt;script type="text/javascript" src="@new FileStreamResult(Assembly.GetExecutingAssembly().GetManifestResourceStream("Defalut.Namespace.javascript.jsFile.js"), "text/javascript")"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>result:</p>
  
  <pre><code>&lt;script type="text/javascript" src="System.Web.Mvc.FileStreamResult"&gt;&lt;/script&gt;
  </code></pre>