问题列表 - 第25918页

一个Windows安装程序中的32位和64位程序集

我有一个用C#编写的应用程序,它依赖于sqlite托管提供程序.sqlite提供程序是依赖于平台的(有两个dll用于32位和64位具有相同名称的应用程序).应用程序在运行时基于OS加载所需的一个.

问题是,在创建安装程序时,我无法将64位模式dll添加到安装项目中,因为我收到以下错误:文件"'目标''与项目的目标平台不兼容''.

我会使用其他安装程序,但我有一个自定义操作,必须在安装过程中调用.

所以我想知道是否有一个安装程序可以让我添加32位和64位dll并执行用C#编写的自定义操作.

一个可能的解决方案是有两个安装程序,但我想尽可能避免它.

有什么建议?

.net installer 64-bit windows-installer custom-action

6
推荐指数
1
解决办法
3152
查看次数

难以启动基本单元测试(样本来自我的书 - SportsStore)

我是TDD的新手,实际上,我正在尝试按照我的书中的样本(SportsStore - Pro ASP.NET MVC Framework/Steve Sanderson/APRESS).我在第103-105页.

虽然还有更多内容,但对于所有这一切都是新的,我关注以下陈述.

ProductsController controller = new ProductsController(repository);
var result = controller.List(2);
     //...
Run Code Online (Sandbox Code Playgroud)

关于上述陈述,当我写这篇文章时(如书中所述),

var products = result.ViewData.Model as IList<Product>;
Run Code Online (Sandbox Code Playgroud)

我得到一个编译错误" System.Web.MVC.ActionResult"不包含ViewData的定义... "但是,当我从语句中删除List()时,编译器错误消失了.

var result = controller.List(2);//Doesn't work
var result = controller;//It works
Run Code Online (Sandbox Code Playgroud)

有什么不对吗?我检查了Apress网站上的那本书,但没有列为勘误或问题.所以我真的迷路了.

谢谢你的帮助

asp.net-mvc unit-testing

5
推荐指数
1
解决办法
1335
查看次数

使用共享缓存和会话部署多个Grails实例?

我正在寻找一个解决方案,允许我部署多个负载平衡的Grails实例,这些实例具有共享缓存(EhCache Server?)和会话,这可能吗?

我找不到任何关于此的文档(连接到常见的EhCache服务器或使用Distributed EhCache,以及共享会话(使用EhCache?))...

我正在寻找能够像多个Rails实例一样工作的东西,它们具有存储在memcached中的公共memcached和会话/缓存......

deployment grails load-balancing ehcache cluster-computing

6
推荐指数
1
解决办法
2994
查看次数

乘客问题:"没有这样的文件加载" - /config/environment

我一直在研究这个,并在这里和那里找到类似问题的参考,但它们都没有导致解决方案.我安装了乘客(2.2.11)和nginx(0.7.64),当我启动并点击Rails URL时,我得到一个错误页面,通知我一个加载错误:

没有这样的文件加载 - /path/to/app/config/environment

从我在网上找到的这似乎是某种用户/权限错误,但我已经尝试了所有逻辑修复:我已经确保/config/environment.rb不是root所有,而是由一个webapp用户.我尝试过设置passenger_default_user,我尝试过设置passenger_user_switching.我甚至尝试过设置nginx用户,尽管这并不重要.我得到了一些不同的结果,但实际上没有任何效果.我希望有人可能拥有这种神奇的设置和权限组合.我可能会尝试退回到早期版本的Passenger,因为我之前从未遇到过这个问题; 自从我成立Passenger之后已经有一段时间了.

谢谢你的任何建议.

编辑:见下面我偶然发现的答案.

ruby-on-rails passenger nginx

5
推荐指数
1
解决办法
7119
查看次数

学习WinForms值得吗?它已经过时了吗?

我刚刚完成了两个WinForm应用程序,作为强化课程的一部分.只是想知道整体技术......我应该转向新的东西,还是WinForms对未来仍然可行?

.net c# winforms

16
推荐指数
2
解决办法
3667
查看次数

如何在C#中编组int*?

我想在非托管库中调用此方法:

void __stdcall GetConstraints(

  unsigned int* puiMaxWidth,

  unsigned int* puiMaxHeight,

  unsigned int* puiMaxBoxes

);
Run Code Online (Sandbox Code Playgroud)

我的解决方案

  • 代表定义:

    [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void GetConstraintsDel(UIntPtr puiMaxWidth,UIntPtr puiMaxHeight,UIntPtr puiMaxBoxes);

  • 方法的调用:

    // PLUGIN NAME
    GetConstraintsDel getConstraints = (GetConstraintsDel)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(GetConstraintsDel));
    
     uint maxWidth, maxHeight, maxBoxes;
    
     unsafe
     {
        UIntPtr a = new UIntPtr(&maxWidth);
        UIntPtr b = new UIntPtr(&maxHeight);
        UIntPtr c = new UIntPtr(&maxBoxes);
        getConstraints(a, b, c);
     }
    
    Run Code Online (Sandbox Code Playgroud)

它有效,但我必须允许"不安全"的标志.有没有不安全代码的解决方案?或者这个解决方案好吗?我不太明白用不安全标志设置项目的含义.

感谢帮助!

.net marshalling intptr

6
推荐指数
1
解决办法
4327
查看次数

C++,如何在头文件中声明结构

我一直试图在student.h文件中包含一个名为"student"的结构,但我不太清楚如何做到这一点.

我的student.h文件代码完全包含:

#include<string>
using namespace std;

struct Student;
Run Code Online (Sandbox Code Playgroud)

student.cpp文件完全由以下内容组成:

#include<string>
using namespace std;

struct Student {
    string lastName, firstName;
    //long list of other strings... just strings though
};
Run Code Online (Sandbox Code Playgroud)

不幸的是,使用的文件#include "student.h"会出现很多错误

error C2027: use of undefined type 'Student'

error C2079: 'newStudent' uses undefined struct 'Student'  (where newStudent is a function with a `Student` parameter)

error C2228: left of '.lastName' must have class/struct/union 
Run Code Online (Sandbox Code Playgroud)

编译器(VC++)似乎无法识别"student.h"中的struct Student?

如何在"student.h"中声明struct Student,以便我可以#include"student.h"并开始使用struct?

c++ struct header include header-files

22
推荐指数
4
解决办法
11万
查看次数

如何在第三方jar中禁用log4j?

我正在尝试使用JBoss焊接编写一个java SE swing应用程序.Weld使用jar中的以下log4j.xml文件使用log4j配置日志记录:

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<!--

    JBoss, Home of Professional Open Source
    Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
    contributors by the @authors tag. See the copyright.txt in the
    distribution for a full listing of individual contributors.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law …
Run Code Online (Sandbox Code Playgroud)

java log4j

15
推荐指数
1
解决办法
2万
查看次数

Visual Studio 2010 Reporting Services项目?

因此,似乎Visual Studio 2010不支持SSRS项目.至少不是旧的..有谁知道这种情况的状态是什么,是否可以使用VS2010创作新的SSRS报告,或者是否应该只使用VS2008 BIDS?

sql-server visual-studio-2010 reporting-services

14
推荐指数
2
解决办法
3万
查看次数

记录ODBC,SQL Server

如何通过ODBC驱动程序记录,跟踪或获取应用程序发送到Microsoft SQL Server 2008的查询(无需修改应用程序...)

也许它可以用SQL Server本身完成,或者ODBC有一些查询记录?

sql logging odbc profiling sql-server-2008

5
推荐指数
1
解决办法
7587
查看次数