Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use portable pdb for .NET Framework #484

Merged
merged 5 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Unreleased

* .NET Framework builds now includes the smaller portable pdb's instead of of the old "full" windows style pdb's
* NOTE: For .NET Framework apps ensure that *supportedRuntime* in *app.config* and corresponding setting in *web.config* does not specify an older runtime if you wan't line numbers in stack traces.

# 5.4.2 / AspNetCore 1.0.0

### .NET8
Expand Down
6 changes: 0 additions & 6 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,7 @@
<AssemblyOriginatorKeyFile Condition="'$(AssemblyOriginatorKeyFile)' == '' And '$(IsTestProject)' == 'true'">$(MSBuildThisFileDirectory)\snk\Tests.snk</AssemblyOriginatorKeyFile>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>

<!-- opt out from portable pdbs, for better compability with older net framework releases
This is required for several test related projects since code generation's
pdb reader cannot read the portable ones
-->
<DebugType>portable</DebugType>
<DebugType Condition="$(TargetFramework.StartsWith('net4')) OR '$(IsTestProject)'=='true'">pdbonly</DebugType>

</PropertyGroup>

<PropertyGroup Condition="'$(GitVersion_AssemblySemVer)' != ''">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
<DefineConstants>$(DefineConstants);DBCONTEXT</DefineConstants>
<Version>1.0.0.0</Version>
</PropertyGroup>
<Target Name="WriteProjectPath">
<Message Text="Writing project path" />
<WriteLinesToFile File="ProjectPath.txt" Lines="$(MSBuildProjectFullPath),Generated_Code," Overwrite="true" />
</Target>
<ItemGroup>
<PackageReference Include="EntityFramework" Version="6.4.4" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<Version>1.0.0.0</Version>
</PropertyGroup>
<Target Name="WriteProjectPath" BeforeTargets="GetCopyToOutputDirectoryItems">
<Message Text="Writing project path" />
<WriteLinesToFile File="ProjectPath.txt" Lines="$(MSBuildProjectFullPath),Generated_Code," Overwrite="true" />
</Target>
<ItemGroup>
<PackageReference Include="EntityFramework" Version="6.4.4" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
</PropertyGroup>
<Target Name="WriteProjectPath" BeforeTargets="GetCopyToOutputDirectoryItems">
<Message Text="Writing project path" />
<WriteLinesToFile File="ProjectPath.txt" Lines="$(MSBuildProjectFullPath),Generated_Code," Overwrite="true" />
</Target>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
Expand Down
23 changes: 11 additions & 12 deletions src/OpenRiaServices.Tools/Test/NotificationMethodGeneratorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.CodeDom;
using System.Collections.Generic;
using OpenRiaServices.Server;
using OpenRiaServices.Server.Test.Utilities;
using System.Xml;
using Microsoft.VisualStudio.TestTools.UnitTesting;

Expand Down Expand Up @@ -41,7 +40,7 @@ public static IEnumerable<object> PartialMethodsSnippetBlockTestCases
DynamicData(nameof(PartialMethodsSnippetBlockTestCases))]
public void PartialMethodsSnippetBlockTest(string comments, string baseMethodNames, string parameters)
{
string[] baseMethodNamesArray = baseMethodNames.Split(new char[] { ',' });
string[] baseMethodNamesArray = baseMethodNames.Split(',');

PartialMethodsSnippetBlockTest(true, comments, baseMethodNamesArray, parameters);
PartialMethodsSnippetBlockTest(false, comments, baseMethodNamesArray, parameters);
Expand Down Expand Up @@ -82,7 +81,7 @@ public void PartialMethodsSnippetBlockTest(bool isCSharp, string comments, strin
}
snippetstr += snippet.Text;
}
Assert.AreEqual(snippetstr.Replace("\r\n", "").TrimEnd(), XmlReader.Value.Replace("\n", ""));
Assert.AreEqual(XmlReader.Value.Replace("\n", ""), snippetstr.Replace("\r\n", "").TrimEnd());
}

[TestMethod]
Expand All @@ -96,7 +95,7 @@ public void OnCreatedMethodInvokeExpressionTest(bool isCSharp)
{
NotificationMethodGenerator target = new NotificationMethodGenerator(CreateProxyGenerator(isCSharp));

Assert.AreEqual(target.OnCreatedMethodInvokeExpression.Method.MethodName, "OnCreated");
Assert.AreEqual("OnCreated", target.OnCreatedMethodInvokeExpression.Method.MethodName);
}

public static IEnumerable<object> OnCreatedMethodInvokeExpressionTestCases
Expand All @@ -108,7 +107,7 @@ public static IEnumerable<object> OnCreatedMethodInvokeExpressionTestCases
]
public void GetMethodInvokeExpressionStatementForTest(string comments, string baseMethodNames, string parameters)
{
string[] baseMethodNamesArray = baseMethodNames.Split(new char[] { ',' });
string[] baseMethodNamesArray = baseMethodNames.Split(',');

GetMethodInvokeExpressionStatementForTest(true, comments, baseMethodNamesArray, parameters);
GetMethodInvokeExpressionStatementForTest(false, comments, baseMethodNamesArray, parameters);
Expand All @@ -128,14 +127,14 @@ public void GetMethodInvokeExpressionStatementForTest(bool isCSharp, string comm
target.AddMethodFor(baseMethodName, expressions, comments);

CodeExpressionStatement actual = target.GetMethodInvokeExpressionStatementFor(baseMethodName);
CodeMethodInvokeExpression actualExpression = actual.Expression as CodeMethodInvokeExpression;
CodeMethodInvokeExpression actualExpression = (CodeMethodInvokeExpression)actual.Expression;

Assert.AreEqual(actualExpression.Method.MethodName, "On" + baseMethodName);
Assert.AreEqual("On" + baseMethodName, actualExpression.Method.MethodName);
Fixed Show fixed Hide fixed

for (int idx = 0; idx < parameters.Length; idx++)
{
string paramName = ((CodeArgumentReferenceExpression)actualExpression.Parameters[idx]).ParameterName;
Assert.AreEqual(paramName, parameters[idx].Name);
Assert.AreEqual(parameters[idx].Name, paramName);
}
}
}
Expand Down Expand Up @@ -188,7 +187,7 @@ public void AddMethodFor2Test(bool isCSharp, string comments, string paramDeclAr
}
else if (paramDeclArgs != "null")
{
string[] args = paramDeclArgs.Split(new char[] { ',' });
string[] args = paramDeclArgs.Split(',');
parameterDeclaration = new CodeParameterDeclarationExpression(args[0], args[1]);
}

Expand Down Expand Up @@ -251,13 +250,13 @@ private static CodeParameterDeclarationExpressionCollection GetCodeParameterDecl
{
parameters = new CodeParameterDeclarationExpressionCollection();

string[] paramDecls = paramDeclsArgs.Split(new char[] { ';' });
string[] paramDecls = paramDeclsArgs.Split(';');
foreach (string paramDecl in paramDecls)
{
if (paramDecl != "")
{
string[] args = paramDecl.Split(new char[] { ',' });
Assert.AreEqual(args.Length, 2, "Params definition file not in the correct format!");
string[] args = paramDecl.Split(',');
Assert.AreEqual(2, args.Length, "Params definition file not in the correct format!");
CodeParameterDeclarationExpression codeParam = new CodeParameterDeclarationExpression(args[0], args[1]);
parameters.Add(codeParam);
}
Expand Down
Loading