My project has Help folder which is located within web project AND in which we kept some template excel files.
When we do "Web Publishing", these files does not get copied on the server. If we change the extension to xml from xslx then they get copied.
Can you please suggest something to change the publishing scheme/method?
Have a nice weekend!!!
Set the "Copy to Output Directory" flag in the File Properties
Select the file in Solution Explorer, and in the properties window change Build Action to Content.
For more background information on how files are selected for publishing, see
http://msdn.microsoft.com/en-us/library/ee942158.aspx#why_dont_all_files_get_deployed
Related
This is my first question here!
I have one ASP.NET MVC 3 Project with a Properties folder, containing some .resx files used to difference content in my views by language (en/es).
I'm working in VS2010 with .Net 4.
When I deploy the application to server, I find that no resx files are published, and instead of it, I have some .dll files.
I have set the build action to Embedded resource , Do not copy to output directory and PublicResXFileCodeGenerator as Custom Tool in .resx files properties.
I want to have .resx files on the server and be able to edit them without recompile or redeploy. The views should use those changes.
How can I do that?
Thanks for your help!!
Put the resx files in your App_GlobalResources and change the "Build Action" to Content and "Copy To Output Directory" to false.
Make sure the "Custom Tool" is set to GlobalResourceProxyGenerator
That should make them changeable even at runtime.
You can simply use xpath to query over them, take the keys, values and comments and edit them as you wish using an XDocument.
You should also know that such a thing won't work with visual studio's publish because App_GlobalResources is not allowed with precompiled website.
We are using .resx files for internationalizing our app. Our solution and tests (mstest) works perfectly localy, and when deployed, however when we try to run the tests from Team Foundation Server (TFS) it seems the resource files are not found (all strings are always returned in en-US).
For each resource file, we have selected:
"Embedded Resource" for the Build Action
"Copy if newer" for the Copy to Output...
"PublicResXFileCodeGenerator" for the Custom tool
Any suggestions on what we could do to fix this?
Build Action = "Content"
Copy to output directory = "Copy always"
Please make above changes.
Often after publishing my MVC3 app, using a file system publish, when I next try to run the app in the VS2010 debugger, I get the error: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. I get this because my web.config file has been duplicated in a folder called obj\debugrelease\package\packagetmp\web.config, where debugrelease is the name of the build config I am publishing to. Simply deleting the whole obj folder solves this issue, but I'm annoyed that it happens and can't help wondering what is wrong.
Have you tried the following?:
Looking at project properties >> Package/Publish Web tab to see if there is anything not set quite right, for instance I have "Deploy only files needed to run this application".
Showing all files in your project to make sure you haven't got web.config files hiding somewhere other than your obj folder.
Opening your project file in a text editor to see if the config is referencing a web.config file somewhere it shouldn't?
I have a folder in my /Content folder which is not being included when I build and publish my website. Only the standard CSS, Images, Scripts and themes folders have been included. I also have a Downloads folder containing .doc files that has not been included.
Am I limited to the standard set at the level below /Content?
Empty folders typically don't get deployed.
For the Downloads folder, what's the "Build Action" set to for the items that it contains? They should be set to "Content" for anything that you want deployed. This isn't automatically set for some file types, such as PDF, etc.
The only items that get deployed have to be both referenced in the project (that is, they have to appear in the solution explorer, not just present in the folder on disk)
, and have the correct build action set.
You might also set the "Copy To Output Directory" setting to True and see what happens.
In Visual Studio, right click on every folder underneath /Content folder, and choose Include In Project. Else, the files are only physically there on disk but the project doesn't know they are there and doesn't publish them.
I know I can add a icon to the Resources.resx file of a project and then reference that icon from within the code.
How do I set the icon of the entire EXE from the resources? All I see is a place to browse for another file. I want to use the current icon file that I have in my resources and not have to have a duplicate file in my project...
thanks
The way that the adding of an application icon is that you must select it from the local file system, and then it is embedded into the application at build time. As far as I know it is not possible to have it first pull from a resource file.
One solution I always use to prevent duplicate file references, is to create a solution folder such as "Project Dependencies". And then all refereces are made from that folder, so when building it pulls from the Project Dependencies folder.
This would work for resource files also, just copy them to the solution folder first and then drag them into your resource.
And for the assembly icon, just browse to the Project Dependencies folder as well.
Good Luck!