%列出% \微软。NET\assembly\是新的GAC。这是否意味着我们现在必须管理两个gac,一个用于。net 2.0-3.5应用程序,另一个用于。net 4.0应用程序?

问题是,为什么?

我使用Visual Studio 2010 RC运行Windows 7 Ultimate(64位)。我最近决定让VS在IIS上运行/调试我的应用程序,而不是在附带的开发服务器上。

然而,每次我尝试运行MVC应用程序,我得到以下错误:

HTTP错误403.14 -禁止Web服务器被配置为不列出此目录的内容。详细的

错误信息

模块DirectoryListingModule

通知ExecuteRequestHandler

汉德勒统计错误

代码0x00000000请求

URL http://localhost: 80 / mySite /

物理 路径C: \ myProject \ mySite \

登录方法匿名登录

匿名用户

我设置了一个默认值。aspx文件在目录中,我收到以下错误:

HTTP错误500.21 -内部服务器 错误处理程序 "PageHandlerFactory-Integrated"有一个 坏模块“ManagedPipelineHandler”在 其模块列表

还有其他我忘了做的步骤吗?

注意:我在安装VS 2010 RC之后安装了iis7.5。在Visual Studio 2010中,我使用了MVC项目的“属性”中“Web”选项卡下的内置“创建虚拟目录”按钮。我确保应用程序使用的是ASP。NET 4应用程序池。

下面是我已经安装的IIS特性。

Microsoft . net Framework 4.0完整安装程序(32位和64位)为48.1 MB, Client Profile安装程序为41.0 MB。解压后的安装文件分别为237 MB和194 MB,安装完成后分别为537 MB和427 MB。

这是110 MB的差异。这两个包之间有什么区别?

什么时候最好安装客户端配置文件而不是完整的。net框架?

我喜欢元组。它们允许您快速地将相关信息分组在一起,而不必为此编写结构或类。这在重构非常本地化的代码时非常有用。

然而,初始化它们的列表似乎有点多余。

var tupleList = new List<Tuple<int, string>>
{
    Tuple.Create( 1, "cow" ),
    Tuple.Create( 5, "chickens" ),
    Tuple.Create( 1, "airplane" )
};

难道没有更好的办法吗?我希望有一个类似Dictionary初始化式的解决方案。

Dictionary<int, string> students = new Dictionary<int, string>()
{
    { 111, "bleh" },
    { 112, "bloeh" },
    { 113, "blah" }
};

我们不能使用类似的语法吗?

我安装了DotNetOpenAuth SDK-3.4.5.10201。vsix,我不能让它工作。它在本地工作(当我作为localhost运行时),但当我尝试发布它不工作。

我得到的IIS错误消息是:

错误总结 HTTP错误500.22 -内部服务器错误 一个ASP。检测到在集成管理管道模式中不适用的NET设置。

and:

模块ConfigurationValidationModule 通知BeginRequest 处理程序StaticFile 错误码0x80070032

下面就如何解决这个问题给出一些建议:

Things you can try: Migrate the configuration to the system.webServer/modules section. You can do so manually or by using AppCmd from the command line - for example, %SystemRoot%\system32\inetsrv\appcmd migrate config "Default Web Site/". Using AppCmd to migrate your application will enable it to work in Integrated mode, and continue to work in Classic mode and on previous versions of IIS. If you are certain that it is OK to ignore this error, it can be disabled by setting system.webServer/validation@validateIntegratedModeConfiguration to false. Alternatively, switch the application to a Classic mode application pool - for example, %SystemRoot%\system32\inetsrv\appcmd set app "Default Web Site/" /applicationPool:"Classic .NET AppPool". Only do this if you are unable to migrate your application. (Set "Default Web Site" and "Classic .NET AppPool" to your application path and application pool name)

问题是我没有访问ISS服务器的权限,因为我不是它的所有者。有办法解决这个问题吗?

试图在构建服务器上构建我的项目给我以下错误:

Microsoft (R) Build Engine Version 4.0.30319.1
error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

几个月前,我通过在Build Server上安装Visual Studio 2010解决了这个问题。但是现在我从头开始安装一个新的服务器,我想知道是否有更好的解决方案来解决这个问题。

我有一个项目,我想在其中使用一些。net 4.0的功能,但核心要求是我可以使用System.Data.SQLite框架,它是针对2.X编译的。我看到提到这是可能的,比如这里接受的答案,但我不知道如何实现这一点。

当我只是试图运行我的4.0项目,同时引用2。我得到:

混合模式程序集是根据运行时版本“v2.0.50727”构建的 并且不能在4.0运行时加载 配置信息。

需要什么“额外配置”?

对于Visual Studio 2010基于Web的应用程序,我们有配置转换功能,通过它我们可以为不同的环境维护多个配置文件。但同样的功能不适用于Windows服务/WinForms或控制台应用程序的App.Config文件。

这里有一个可用的解决方案:对App.Config应用XDT魔术。

然而,这并不简单,需要一些步骤。是否有更简单的方法来实现同样的app.config文件?

被添加到. net 4中的ExpandoObject类允许您在运行时任意地为对象设置属性。

与使用Dictionary<string, object>,甚至哈希表相比,这有什么优点吗?据我所知,这只是一个哈希表,您可以使用稍微简洁的语法访问它。

举个例子,为什么是这样:

dynamic obj = new ExpandoObject();
obj.MyInt = 3;
obj.MyString = "Foo";
Console.WriteLine(obj.MyString);

比:更好的或有本质区别的:

var obj = new Dictionary<string, object>();
obj["MyInt"] = 3;
obj["MyString"] = "Foo";

Console.WriteLine(obj["MyString"]);

使用ExpandoObject而不是使用任意的字典类型有什么真正的好处,除了不明显地表明您使用的是将在运行时确定的类型。