简体   繁体   English

如何使用 Src asp.net 内核从同一解决方案中的另一个项目获取图像?

[英]how to get image from another project in the same solution with Src asp.net core?

I've two project in the same solution.我在同一个解决方案中有两个项目。 I am trying to pick up an image from folder in project1 to project 2 in cshtml file.我正在尝试从 project1 中的文件夹中提取图像到 cshtml 文件中的项目 2。 Any idea how to do this?知道怎么做吗?

Jlidi,吉丽迪,

If you are trying to reference an image from another project you won't be able to directly reference any source outside your current project, you will need to import the image from the other project into your existing.如果您尝试从另一个项目中引用图像,您将无法直接引用当前项目之外的任何源,您需要将图像从另一个项目导入到您现有的项目中。

Unless this has to be separate I would just recommend making a copy of the image and placing it in both projects, you can perform an import on the image from an existing project but it will essentially just create a copy in your (RESX) Resource file in your existing project.除非这必须分开,否则我只建议制作图像的副本并将其放置在两个项目中,您可以从现有项目中对图像执行导入,但它实际上只会在您的 (RESX) 资源文件中创建一个副本在您现有的项目中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Asp.Net Core v1.1从同一解决方案中的另一个项目获取继承的类名 - Asp.Net Core v1.1 Get Inherited Class Names From another project in same solution ASP.NET Core:从解决方案中的另一个项目访问appsettings - ASP.NET Core: Accessing appsettings from another project in solution 是否可以在另一个解决方案中从 ASP.NET Webforms 项目中引用 ASP.NET Core 2.0 类库 dll? - Possible to reference an ASP.NET Core 2.0 class library dll from an ASP.NET Webforms project in another solution? 如何在同一解决方案 Asp .NET Core 3 中的另一个项目中调用 Session 变量 - How to call Session variables in another project in the Same Solution Asp .NET Core 3 从另一个项目访问文件与ASP.NET MVC相同的解决方案 - Access files from another project same solution asp.net mvc 如何在Singe Solution ASP.net中将控制权从一个项目转移到另一个项目? - How to transfer control from one Project to another project in a Singe Solution ASP.net? 在同一个解决方案中结合 ASP.NET 和 ASP.NET 核心 - Combine ASP.NET and ASP.NET core in the same solution 发布时从另一个ASP.NET Core 2项目引用ASP.NET Core 2项目失败 - Referencing ASP.NET Core 2 project from another ASP.NET Core 2 project fails when publishing 如何在同一项目中的ASP.NET MVC控制器中从ASP.NET Web API获取数据 - How get data from asp.net web api in asp.net mvc controller in the same project 在ASP.NET核心中使用时,如何从另一个项目访问EF核心的DbContext? - How to I access the DbContext of EF core from another project when used in ASP.NET core?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM