Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8003793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:44:49+00:00 2026-06-04T16:44:49+00:00

For some reason in VS2010 I can’t embed any file into an assembly. These

  • 0

For some reason in VS2010 I can’t embed any file into an assembly. These files have their Build Action property set to Embedded Resource as they should, but when the assembly is executed it founds no resources. For example, the following test code:

string[] list = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames();
string msg = (list.Length > 0) ? "Full" : "Empty";
MessageBox.Show(msg);

always shows “Empty” because GetManifestResourceNames() always returns an empty list.

This issue affects a project using nettiers in which is not convenient for that particular case to include the stored procedures into the DB, so they must be taken from the Procedures.xml file, which BTW is automatically set with Build Action= Embedded Resource after the classes generation, and then of course when a function tries to get any SQL script from it, the program fails.

I also created a couple of test projects where I tried to embed an xml and a gif, always with no success.

Update: The problem seems to be only for C#. I reproduced the test project in VB.Net and there the file does get embedded. I’ve noticed that in the output window, in the C# case, the compiler command line doesn’t include the /resource option (which should be there followed with the name of the file to embed) whereas for the VB case it does appear.

Are there any global settings or configuration files anywhere for C# I should check? (The build options for the project have nothing strange there)

Does anyone have an idea of what may be happening and how to fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:44:50+00:00Added an answer on June 4, 2026 at 4:44 pm

    Finally, I found the cause:

    There was a wrong line inside the Microsoft.CSharp.targets file (located inside c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319). There was a tag written as:

    <EmbeddedResourceF Include=”@(_Temporary)” />

    instead of

    <EmbeddedResource Include=”@(_Temporary)” />

    Writing it right restored the ability to embed files

    How that F appeared and why that file got altered in first place, I dont know… Despite being a .NET programmer for several years I just became aware today of the “.targets” files after searching the web about this issue, as never have had the need to look about the MSBuild stuff.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, VS2010 refuses to do automatic code completion on ASPX.CS files. Any
For some reason CodeIgniter is not connecting to my SMTP server, anyone have any
For some reason, I can get the split method to work. I honestly have
For some reason I can't detect I can't set a z index for any
For some reason, I can't get the John Resig micro template to work. I've
For some reason, when I open a CSV file, that appears totally fine in
For some reason I thought this should work but its eluding me I have
For some reason when I make a GET request, it seems to go into
OK, for some reason Microsoft removed System.Web but we can import System.Net.WebUtility and call
In a very old code base, we have some build settings for our visual

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.