在构建服务器上构建使用 Crystal Reports 的 .NET 程序集

发布于 2024-09-16 22:36:58 字数 504 浏览 1 评论 0原文

我正在尝试在构建服务器上构建一个使用 Crystal Reports 的 .NET 程序集,而无需安装 Visual Studio 或 Crystal Reports 运行时。

我们在代码中定位的 Crystal Reports 版本是 Visual Studio 2008 附带的版本,我们使用 MSBuild 来构建此项目。

我已将项目中似乎所有引用的 dll 复制到构建服务器上名为 Assemblies 的文件夹中,并尝试在 csproj.user 文件中设置引用路径,并将相同的 PropertyGroup 复制到我的项目中文件但仍然没有运气。我收到的错误类似于下面的示例。

MyFile.cs(5,7):错误 CS0246:类型 或命名空间名称“CrystalDecisions” 找不到(您是否缺少 using 指令或程序集 参考?) [c:\MySolution\MyProject...]

有人对我如何或是否能够使其工作有任何建议吗?

I'm trying to Build a .NET assembly which uses Crystal Reports on a build server without installing Visual Studio or the Crystal Reports Runtime.

The version of Crystal Reports we are targeting in our code is the one that came along with Visual Studio 2008 and we are using MSBuild to build this project.

I've copied what seems to be all of the referenced dlls in my project into a folder called Assemblies on the build server and I've tried setting the reference path in my csproj.user file and also by copying this same PropertyGroup into my project file but still no luck. The error I'm getting looks like the example below.

MyFile.cs(5,7): error CS0246: The type
or namespace name 'CrystalDecisions'
could not be found (are you missing a
using directive or an assembly
reference?)
[c:\MySolution\MyProject...]

Does anybody have any suggestions on how or whether I should be able to get this to work?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

朦胧时间 2024-09-23 22:36:58

看来我在尝试了项目文件中的参考元素后自己可能已经弄清楚了这一点。我的 Crystal Reports 程序集引用现在如下例所示。

<Reference Include="CrystalDecisions.CrystalReports.Engine, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304">
    <HintPath>$(MSBuildProjectDirectory)\..\Libraries\CrystalReports\CrystalDecisions.CrystalReports.Engine.dll</HintPath>
</Reference>
<Reference Include="CrystalDecisions.ReportSource, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304">
    <HintPath>$(MSBuildProjectDirectory)\..\Libraries\CrystalReports\CrystalDecisions.ReportSource.dll</HintPath>
</Reference>
<Reference Include="CrystalDecisions.Shared, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304">
    <HintPath>$(MSBuildProjectDirectory)\..\Libraries\CrystalReports\CrystalDecisions.Shared.dll</HintPath>
</Reference>

更重要的是它有效!

It looks like I may have figured out this one myself after experimenting around with the element for my references in the project file. My Crystal Reports assembly references now look like the example below.

<Reference Include="CrystalDecisions.CrystalReports.Engine, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304">
    <HintPath>$(MSBuildProjectDirectory)\..\Libraries\CrystalReports\CrystalDecisions.CrystalReports.Engine.dll</HintPath>
</Reference>
<Reference Include="CrystalDecisions.ReportSource, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304">
    <HintPath>$(MSBuildProjectDirectory)\..\Libraries\CrystalReports\CrystalDecisions.ReportSource.dll</HintPath>
</Reference>
<Reference Include="CrystalDecisions.Shared, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304">
    <HintPath>$(MSBuildProjectDirectory)\..\Libraries\CrystalReports\CrystalDecisions.Shared.dll</HintPath>
</Reference>

And even more importantly it works!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文