English 中文(简体)
当我把目标框架改为4.0时,为什么我的WPF 3.5想获得一 app。
原标题:Why did my WPF 3.5 app gain an app.config file when I changed the target framework to 4.0?

我改变了目标。 我的计生联框架从3.5到4.0。

在作出这一改动后,我注意到,VS2010年生成了一台 app子,并放置在主要项目夹中。 其建立行动是“不——不复制”。

The app.config file contained the following XML:

<?xml version="1.0"?>
<configuration>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    </startup>
</configuration>

我的项目文件载有:

<Project
    ToolsVersion="4.0" DefaultTargets="Build"
    xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

< Questions:

  1. What is the difference in meaning between <supportedRuntime version="4.0" in app.config and <Project ToolsVersion="4.0" in .csproj? Does one override the other or do they actually mean different things?
  2. Does the app.config file do anything if not copied to the output directory?
  3. Can I delete the app.config file without breaking anything?

<><>Edit>/strong>

还有一个问题:

如果我从rat中得出4.0 app,那么为什么没有 app子。 (这并不意味着档案没有必要?)

最佳回答

微软博客文章对此做了很好的解释:

http://blogs.msdn.com/b/jgoldb/archive/04/12/what-s-new-in-net-framework-4-client-profile-rtm.aspx”rel=“nofollow noretinger” http://blogs.msdn.com/b/jgoldb/archive/04/12/what-s-new-in-net-framework-4-client-rtm.aspx

www.un.org/Depts/DGACM/index_spanish.htm 如何处理 app?

如果您将该项目改名为“全面框架”,联邦统计局将增加一个组合文件(申请),宣布申请为“完整”申请。

“alt

这使得航天中心负荷员能够阻挡任何网络4的仪器,完全瞄准只有用户简介的机器。 在这种情况下,《刑法》促使用户安装网络4。

例如,你可以看到这一辩证:

“alt

Note that in NET4 Beta1 and NET3.5 SP1 Client Profile, if the app.config was missing the CLR, the assumption was that you targeted the Full Framework. This is now reversed. In other words, if your NET4 app is missing app.config, by default the CLR assumes that your app is targeting NET4 Client Profile! So, your app may crash at random when it needs to load the assemblies that aren t in the Client Profile.

<>Specific Responsess:

  1. SLaks说,csproj环境告诉汇编者,框架版本将使用什么,而计算时间(CLR)则使用总书,以确定哪(如果有)框架版本用户需要下载。

  2. 注:即使建筑行动是“无——不复制”的,也将对产出进行复印。 页: 1

  3. 对于WPF 4.0 app,如果 app指目标,可省略。 NET 4.0 客户概况。 如果它针对整个网络4.0框架(包括像p.net等内容),则必须保存档案。

  4. 这一档案不是由于违约而形成的,原因是WPF 4.0与目标。 NET Framework 4.0 Current Profile byail. 由于时间的推移将假定所有时间。 NET 4.0 只需要安装的客户概况,所有东西都将被罚款。

问题回答

The App.config file tells the .Net runtime that the assembly requires .Net 4.0.
It gets copied to the outout folder as <YourApp>.exe.config.

  1. The .csproj is only used at compile time.
  2. No; App.config is read by the runtime from the assembly s directory
  3. No, you shouldn t.




相关问题
Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How do I compare two decimals to 10 decimal places?

I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....

Exception practices when creating a SynchronizationContext?

I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...

Show running instance in single instance application

I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签