I created a couple of App_LocalResource folders along with alot of resx files in my MVC4 solution. But when web-deploying to Azure, they aren't recoqnized/found/listed in change sets. None of the folders are pushed to Azure. I can't add them to the solution cause they are already there? I created the folders through VS so i suppose they are included in the solution on creation.
我在我的MVC4解决方案中创建了几个App_LocalResource文件夹以及很多resx文件。但是,当Web部署到Azure时,它们不会在更改集中重新定义/找到/列出。没有文件夹被推送到Azure。我无法将它们添加到解决方案中,因为它们已经存在?我通过VS创建了文件夹,所以我想它们包含在创建解决方案中。
What do I do?
我该怎么办?
2 个解决方案
#1
1
You need to set each of the .resx files' "Copy to Output Directory" property to "Copy if newer" or "Copy always." If you don't change this property for any of the .resx files in an App_LocalResources folder, the entire folder won't show up in your resulting cloud service package, and it won't appear in the Project/csx/Debug/roles/rolename/approot/bin folder when you debug locally either. When you deploy the package without changing each .resx file's "Copy to Output Directory" property, they won't be included in your service package when its uploaded via web deploy.
您需要将每个.resx文件的“复制到输出目录”属性设置为“如果更新则复制”或“始终复制”。如果您没有为App_LocalResources文件夹中的任何.resx文件更改此属性,整个文件夹将不会显示在生成的云服务包中,并且它不会出现在Project / csx / Debug / roles中在本地调试时,/ rolename / approot / bin文件夹。在不更改每个.resx文件的“复制到输出目录”属性的情况下部署程序包时,如果通过Web部署上载它们,它们将不会包含在您的服务包中。
Also, from a maintainability standpoint, I would recommend looking into using Azure Tables instead of .resx files. They're more flexible in a deployed environment because a Table entity can be changed at runtime if necessary, without redeploying.
另外,从可维护性的角度来看,我建议使用Azure Tables而不是.resx文件。它们在部署环境中更灵活,因为如果需要,可以在运行时更改Table实体,而无需重新部署。
#2
0
I changed Build Action
for the resx file to Content
instead of Embeded Resource
. Embeded Resource
complies the resources into a dll where you cant access the usual way.
我将resx文件的Build Action更改为Content而不是Embeded Resource。 Embeded Resource将资源限制为dll,您无法以通常的方式访问它。
#1
1
You need to set each of the .resx files' "Copy to Output Directory" property to "Copy if newer" or "Copy always." If you don't change this property for any of the .resx files in an App_LocalResources folder, the entire folder won't show up in your resulting cloud service package, and it won't appear in the Project/csx/Debug/roles/rolename/approot/bin folder when you debug locally either. When you deploy the package without changing each .resx file's "Copy to Output Directory" property, they won't be included in your service package when its uploaded via web deploy.
您需要将每个.resx文件的“复制到输出目录”属性设置为“如果更新则复制”或“始终复制”。如果您没有为App_LocalResources文件夹中的任何.resx文件更改此属性,整个文件夹将不会显示在生成的云服务包中,并且它不会出现在Project / csx / Debug / roles中在本地调试时,/ rolename / approot / bin文件夹。在不更改每个.resx文件的“复制到输出目录”属性的情况下部署程序包时,如果通过Web部署上载它们,它们将不会包含在您的服务包中。
Also, from a maintainability standpoint, I would recommend looking into using Azure Tables instead of .resx files. They're more flexible in a deployed environment because a Table entity can be changed at runtime if necessary, without redeploying.
另外,从可维护性的角度来看,我建议使用Azure Tables而不是.resx文件。它们在部署环境中更灵活,因为如果需要,可以在运行时更改Table实体,而无需重新部署。
#2
0
I changed Build Action
for the resx file to Content
instead of Embeded Resource
. Embeded Resource
complies the resources into a dll where you cant access the usual way.
我将resx文件的Build Action更改为Content而不是Embeded Resource。 Embeded Resource将资源限制为dll,您无法以通常的方式访问它。