B
bonk
I have a c# project as part of a larger VS 2005 solution that always
gets build optimized and I therefore can not evaluate any values while
debugging through the code ("Cannot evaluate expression because the
code of the current method is optimized."). This happens alltough the
checkbock "optimize code" in the project settings is switched off. My
question here is what are possible conditions that would make an
assembly be build as optimized even if the project settings state
otherwise. Do the referenced assemblies play a role here? This is a
Winforms WPF interop assembly that references wpf and windows forms.
The hole WPF UI is build using my own c# code so no wpf msbuild tasks
are needed. I attached the project file. Maybe you see something that
I miss.
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/
developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition="'$(Configuration)'==''">Debug</
Configuration>
<DefaultClrNameSpace>OperationCanvasTest</DefaultClrNameSpace>
<AssemblyName>AIS.VCTC3.OperationEditor</AssemblyName>
<OutputPath>bin\$(Configuration)\</OutputPath>
<ApplicationVersion>1.0.0.*</ApplicationVersion>
<ApplicationRevision>0</ApplicationRevision>
<AlwaysCompileMarkupFilesInSeparateDomain>false</
AlwaysCompileMarkupFilesInSeparateDomain>
<OutputType>Library</OutputType>
<RootNamespace>AIS.VCTC3.OperationEditor</RootNamespace>
<ApplicationIcon>
</ApplicationIcon>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ProjectGuid>{4BDDDA83-1DD1-4C33-8DF3-32B114E046FD}</ProjectGuid>
<StartupObject>
</StartupObject>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>
</DefineConstants>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleAssemblies>C:\Programme\Microsoft Visual Studio
8\Team Tools\Static Analysis Tools\FxCop\\rules</
CodeAnalysisRuleAssemblies>
<CodeAnalysisUseTypeNameInSuppression>true</
CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</
CodeAnalysisModuleSuppressionsFile>
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<UseVSHostingProcess>false</UseVSHostingProcess>
<Optimize>false</Optimize>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildBinPath)\Microsoft.WinFX.targets" />
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="Process.Net, Version=0.0.0.0, Culture=neutral">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Programme\AIS\VACNT-32.42\System\Release\Process.Net.dll</
HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="UIAutomationProvider" />
<Reference Include="WindowsBase" />
<Reference Include="WindowsFormsIntegration" />
<Compile Include="DragDropScrollViewer.cs" />
<Compile Include="OperationCanvas.cs" />
<Compile Include="OperationEdior.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="OperationEdior.Designer.cs">
<DependentUpon>OperationEdior.cs</DependentUpon>
</Compile>
<Compile Include="OperationVisual.cs" />
<Compile Include="Timeline.cs" />
</ItemGroup>
<PropertyGroup>
<PostBuildEvent>xcopy /Y "$(TargetDir)$(TargetName).*" "$(SolutionDir)
\out\$(ConfigurationName)\"</PostBuildEvent>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\AIS.VCTC3.Core\AIS.VCTC3.Core.csproj">
<Project>{C365BE10-1043-4897-8D69-15643306EAE2}</Project>
<Name>AIS.VCTC3.Core</Name>
</ProjectReference>
<ProjectReference Include="..\AIS.VCTC3.Interface
\AIS.VCTC3.Interface.csproj">
<Project>{E5F7E025-164E-4F64-BF06-9AD00301BC1E}</Project>
<Name>AIS.VCTC3.Interface</Name>
</ProjectReference>
<ProjectReference Include="..\AIS.VCTC3.Kit\AIS.VCTC3.Kit.csproj">
<Project>{7BF1753E-853B-40C9-94F2-C943A4399980}</Project>
<Name>AIS.VCTC3.Kit</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="OperationEdior.resx">
<SubType>Designer</SubType>
<DependentUpon>OperationEdior.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
</Project>
gets build optimized and I therefore can not evaluate any values while
debugging through the code ("Cannot evaluate expression because the
code of the current method is optimized."). This happens alltough the
checkbock "optimize code" in the project settings is switched off. My
question here is what are possible conditions that would make an
assembly be build as optimized even if the project settings state
otherwise. Do the referenced assemblies play a role here? This is a
Winforms WPF interop assembly that references wpf and windows forms.
The hole WPF UI is build using my own c# code so no wpf msbuild tasks
are needed. I attached the project file. Maybe you see something that
I miss.
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/
developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition="'$(Configuration)'==''">Debug</
Configuration>
<DefaultClrNameSpace>OperationCanvasTest</DefaultClrNameSpace>
<AssemblyName>AIS.VCTC3.OperationEditor</AssemblyName>
<OutputPath>bin\$(Configuration)\</OutputPath>
<ApplicationVersion>1.0.0.*</ApplicationVersion>
<ApplicationRevision>0</ApplicationRevision>
<AlwaysCompileMarkupFilesInSeparateDomain>false</
AlwaysCompileMarkupFilesInSeparateDomain>
<OutputType>Library</OutputType>
<RootNamespace>AIS.VCTC3.OperationEditor</RootNamespace>
<ApplicationIcon>
</ApplicationIcon>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ProjectGuid>{4BDDDA83-1DD1-4C33-8DF3-32B114E046FD}</ProjectGuid>
<StartupObject>
</StartupObject>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>
</DefineConstants>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleAssemblies>C:\Programme\Microsoft Visual Studio
8\Team Tools\Static Analysis Tools\FxCop\\rules</
CodeAnalysisRuleAssemblies>
<CodeAnalysisUseTypeNameInSuppression>true</
CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</
CodeAnalysisModuleSuppressionsFile>
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<UseVSHostingProcess>false</UseVSHostingProcess>
<Optimize>false</Optimize>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildBinPath)\Microsoft.WinFX.targets" />
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="Process.Net, Version=0.0.0.0, Culture=neutral">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Programme\AIS\VACNT-32.42\System\Release\Process.Net.dll</
HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="UIAutomationProvider" />
<Reference Include="WindowsBase" />
<Reference Include="WindowsFormsIntegration" />
<Compile Include="DragDropScrollViewer.cs" />
<Compile Include="OperationCanvas.cs" />
<Compile Include="OperationEdior.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="OperationEdior.Designer.cs">
<DependentUpon>OperationEdior.cs</DependentUpon>
</Compile>
<Compile Include="OperationVisual.cs" />
<Compile Include="Timeline.cs" />
</ItemGroup>
<PropertyGroup>
<PostBuildEvent>xcopy /Y "$(TargetDir)$(TargetName).*" "$(SolutionDir)
\out\$(ConfigurationName)\"</PostBuildEvent>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\AIS.VCTC3.Core\AIS.VCTC3.Core.csproj">
<Project>{C365BE10-1043-4897-8D69-15643306EAE2}</Project>
<Name>AIS.VCTC3.Core</Name>
</ProjectReference>
<ProjectReference Include="..\AIS.VCTC3.Interface
\AIS.VCTC3.Interface.csproj">
<Project>{E5F7E025-164E-4F64-BF06-9AD00301BC1E}</Project>
<Name>AIS.VCTC3.Interface</Name>
</ProjectReference>
<ProjectReference Include="..\AIS.VCTC3.Kit\AIS.VCTC3.Kit.csproj">
<Project>{7BF1753E-853B-40C9-94F2-C943A4399980}</Project>
<Name>AIS.VCTC3.Kit</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="OperationEdior.resx">
<SubType>Designer</SubType>
<DependentUpon>OperationEdior.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
</Project>