﻿<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://developers.de/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Holger&amp;#39;s Blog</title><subtitle type="html"></subtitle><id>http://developers.de/blogs/holger_vetter/atom.aspx</id><link rel="alternate" type="text/html" href="http://developers.de/blogs/holger_vetter/default.aspx" /><link rel="self" type="application/atom+xml" href="http://developers.de/blogs/holger_vetter/atom.aspx" /><generator uri="http://communityserver.org" version="4.0.30619.63">Community Server</generator><updated>2016-04-28T11:20:39Z</updated><entry><title>How to create and publish nuget symbol packages</title><link rel="alternate" type="text/html" href="/blogs/holger_vetter/archive/2017/10/27/how-to-create-and-publish-nuget-symbol-packages.aspx" /><id>/blogs/holger_vetter/archive/2017/10/27/how-to-create-and-publish-nuget-symbol-packages.aspx</id><published>2017-10-27T09:39:12Z</published><updated>2017-10-27T09:39:12Z</updated><content type="html">&lt;p&gt;Creating a nuget package with symbols is quite easy.&lt;/p&gt;  &lt;p&gt;You have 2 possible methods to create a nuget package with symbols:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;From nuspec file. &lt;a href="https://docs.microsoft.com/en-us/nuget/create-packages/creating-a-package#creating-the-nuspec-file"&gt;How to create nuspec file.&lt;/a&gt;      &lt;pre&gt;&lt;code&gt;nuget pack MyPackage.nuspec -Symbols
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;

  &lt;li&gt;From project file.
    &lt;pre&gt;&lt;code&gt;nuget pack MyProject.csproj -Symbols
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Both of the commands will create 2 files &lt;code&gt;{identifier}.symbols.nupkg&lt;/code&gt; and &lt;code&gt;{identifier}.nupkg&lt;/code&gt;.&lt;/p&gt;

&lt;h4&gt;Publishing the nuget package&lt;/h4&gt;

&lt;p&gt;Normally I upload nuget package by just using drag&amp;amp;drop on the nuget &lt;a href="https://www.nuget.org/packages/manage/upload"&gt;upload page&lt;/a&gt;. This doesn&amp;#39;t work with symbol packages, because you have 2 packages in the folder.&lt;/p&gt;

&lt;p&gt;To publish symbol and normal package, you must use the nuget cli.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/nuget/create-packages/publish-a-package"&gt;Get and set your Nuget API key.&lt;/a&gt;&lt;/li&gt;

  &lt;li&gt;Create both (normal + symbol) package. See the 2 possible options above. &lt;/li&gt;

  &lt;li&gt;Run &lt;code&gt;nuget push {identifier}.nupkg -Source https://www.nuget.org/api/v2/package&lt;/code&gt;.

    &lt;br /&gt;This will upload the &lt;code&gt;{identifier}.nupkg&lt;/code&gt; to nuget and &lt;code&gt;{identifier}.symbols.nupkg&lt;/code&gt;to the &lt;a href="http://www.symbolsource.org/Public"&gt;symbol server&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If the uploads were successful, result should look like this:
  &lt;br /&gt;&lt;img alt="27936_symbol_package_upload" src="https://developersde.blob.core.windows.net/usercontent/2017/10/27936_symbol_package_upload.png" width="798" height="128" /&gt;&lt;/p&gt;

&lt;p&gt;Part 2 of this tutorial will show how to use the symbol package to debug trough third party code.&lt;/p&gt;

&lt;p&gt;Sources:
  &lt;br /&gt;&lt;a href="https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages"&gt;https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages&lt;/a&gt;

  &lt;br /&gt;&lt;a href="https://docs.microsoft.com/en-us/nuget/create-packages/publish-a-package"&gt;https://docs.microsoft.com/en-us/nuget/create-packages/publish-a-package&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1809923" width="1" height="1"&gt;</content><author><name>hvetter</name><uri>http://developers.de/members/hvetter/default.aspx</uri></author><category term="nuget" scheme="http://developers.de/blogs/holger_vetter/archive/tags/nuget/default.aspx"></category></entry><entry><title>NullReferenceException with more informations (Propertyname)</title><link rel="alternate" type="text/html" href="/blogs/holger_vetter/archive/2017/10/17/nullreferenceexception-with-more-informations-propertyname.aspx" /><id>/blogs/holger_vetter/archive/2017/10/17/nullreferenceexception-with-more-informations-propertyname.aspx</id><published>2017-10-17T08:44:30Z</published><updated>2017-10-17T08:44:30Z</updated><content type="html">&lt;p&gt;Hey,&lt;/p&gt;  &lt;p&gt;this week I saw this exception in Visual Studio 2017 (15.3.5):   &lt;br /&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/clip_5F00_image001_5F00_680CD1DB.png"&gt;&lt;img title="clip_image001" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="clip_image001" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/clip_5F00_image001_5F00_thumb_5F00_75DF17D6.png" width="322" height="188" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I was wondering when VS got the feature to display the property(getter) which caused the exception.&lt;/p&gt;  &lt;p&gt;Think the feature is new to VS. If anybody knows when this feature was added to VS, please comment below. :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1809737" width="1" height="1"&gt;</content><author><name>hvetter</name><uri>http://developers.de/members/hvetter/default.aspx</uri></author></entry><entry><title>Swagger IncludeXmlComments PlatformServices (obsolete) replacement</title><link rel="alternate" type="text/html" href="/blogs/holger_vetter/archive/2017/06/30/swagger-includexmlcomments-platformservices-obsolete-replacement.aspx" /><id>/blogs/holger_vetter/archive/2017/06/30/swagger-includexmlcomments-platformservices-obsolete-replacement.aspx</id><published>2017-06-30T09:31:13Z</published><updated>2017-06-30T09:31:13Z</updated><content type="html">&lt;p&gt;We migrated a project to ASP.NET Core 2 (preview) and needed to configure swagger.
&lt;/p&gt;&lt;p&gt;In ASP.NET Core v1 we used this code to load the auto generated xml file into swagger:
&lt;/p&gt;&lt;div&gt;&lt;table style="border-collapse:collapse;"&gt;&lt;tr&gt;&lt;td style="padding-left:7px;padding-right:7px;border-top:solid 0.5pt;border-left:solid 0.5pt;border-bottom:solid 0.5pt;border-right:solid 0.5pt;"&gt;&lt;p&gt;           services.ConfigureSwaggerGen(options =&amp;gt;
&lt;/p&gt;&lt;p&gt;            {
&lt;/p&gt;&lt;p&gt;                //Determine base path for the application.
&lt;/p&gt;&lt;p&gt;                var basePath = PlatformServices.Default.Application.ApplicationBasePath;
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;                //Set the comments path for the swagger json and ui.
&lt;/p&gt;&lt;p&gt;                options.IncludeXmlComments(System.IO.Path.Combine(basePath, &amp;quot;ProjectName.xml&amp;quot;));
&lt;/p&gt;&lt;p&gt;            });&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;p&gt;Since PlatformServices is obsolete (&lt;a href="https://github.com/aspnet/PlatformAbstractions"&gt;https://github.com/aspnet/PlatformAbstractions&lt;/a&gt;), you shouldn&amp;#39;t use this for your (new) projects anymore.&lt;br /&gt;Like the github page states, you should use the equivalent .NET API instead.
&lt;/p&gt;&lt;p&gt;Here is what I use instead of PlatFormAbstractions (PlatformServices) for loading the xml into swagger:
&lt;/p&gt;&lt;div&gt;&lt;table style="border-collapse:collapse;"&gt;&lt;tr style="height:203px;"&gt;&lt;td style="padding-left:7px;padding-right:7px;border-top:solid 0.5pt;border-left:solid 0.5pt;border-bottom:solid 0.5pt;border-right:solid 0.5pt;"&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;            services.ConfigureSwaggerGen(options =&amp;gt;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;            {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;
								&lt;span style="color:green;"&gt;//Determine base path for the application.&lt;span style="color:black;"&gt;
									&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;
								&lt;span style="color:blue;"&gt;var&lt;span style="color:black;"&gt; basePath = &lt;span style="color:#2b91af;"&gt;AppContext&lt;span style="color:black;"&gt;.BaseDirectory;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;
								&lt;span style="color:blue;"&gt;var&lt;span style="color:black;"&gt; assemblyName = System.Reflection.&lt;span style="color:#2b91af;"&gt;Assembly&lt;span style="color:black;"&gt;.GetEntryAssembly().GetName().Name;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;
								&lt;span style="color:blue;"&gt;var&lt;span style="color:black;"&gt; fileName = System.IO.&lt;span style="color:#2b91af;"&gt;Path&lt;span style="color:black;"&gt;.GetFileName(assemblyName + &lt;span style="color:#a31515;"&gt;&amp;quot;.xml&amp;quot;&lt;span style="color:black;"&gt;);
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;
								&lt;span style="color:green;"&gt;//Set the comments path for the swagger json and ui.&lt;span style="color:black;"&gt;
									&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;                options.IncludeXmlComments(System.IO.&lt;span style="color:#2b91af;"&gt;Path&lt;span style="color:black;"&gt;.Combine(basePath, fileName));
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;            });&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;p&gt;Hint: You could add a check here, if the file really exists before loading it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1807306" width="1" height="1"&gt;</content><author><name>hvetter</name><uri>http://developers.de/members/hvetter/default.aspx</uri></author></entry><entry><title>Include XML documentation in ASP.NET Core publish</title><link rel="alternate" type="text/html" href="/blogs/holger_vetter/archive/2017/05/15/include-xml-documentation-in-asp-net-core-publish.aspx" /><id>/blogs/holger_vetter/archive/2017/05/15/include-xml-documentation-in-asp-net-core-publish.aspx</id><published>2017-05-15T08:50:26Z</published><updated>2017-05-15T08:50:26Z</updated><content type="html">&lt;p&gt;I am using the auto generated XML file in Swagger. On my dev machine everything worked fine, but after publish the file was gone. This can result in an application crash on startup if you are not checking if the file exists before handing the filepath over to swagger.
&lt;/p&gt;&lt;p&gt;At the moment there is no UI for adding the XML to the publish output. I searched the internet a bit and found this on github: &lt;a href="https://github.com/dotnet/sdk/issues/795"&gt;&lt;span style="color:blue;font-family:Times New Roman;font-size:12pt;text-decoration:underline;"&gt;https://github.com/dotnet/sdk/issues/795&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:Times New Roman;font-size:12pt;"&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;p&gt;I modified it a bit and the result is:
&lt;/p&gt;&lt;div&gt;&lt;table style="border-collapse:collapse;"&gt;&lt;tr&gt;&lt;td style="padding-left:7px;padding-right:7px;border-top:solid 0.5pt;border-left:solid 0.5pt;border-bottom:solid 0.5pt;border-right:solid 0.5pt;"&gt;&lt;p&gt;&amp;lt;Target Name=&amp;quot;PrepublishScript&amp;quot; BeforeTargets=&amp;quot;PrepareForPublish&amp;quot;&amp;gt;
&lt;/p&gt;&lt;p&gt;    &amp;lt;ItemGroup&amp;gt;
&lt;/p&gt;&lt;p&gt;      &amp;lt;DocFile Include=&amp;quot;bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\$(TargetName).xml&amp;quot; /&amp;gt;
&lt;/p&gt;&lt;p&gt;    &amp;lt;/ItemGroup&amp;gt;
&lt;/p&gt;&lt;p&gt;    &amp;lt;Copy SourceFiles=&amp;quot;@(DocFile)&amp;quot; DestinationFolder=&amp;quot;$(PublishDir)&amp;quot; SkipUnchangedFiles=&amp;quot;false&amp;quot; /&amp;gt;
&lt;/p&gt;&lt;p&gt;  &amp;lt;/Target&amp;gt;
&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;p&gt;It uses placeholders to be generic and it can be used with any project.
&lt;/p&gt;&lt;p&gt;Just add this to your *.csproj file and you are done.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1806294" width="1" height="1"&gt;</content><author><name>hvetter</name><uri>http://developers.de/members/hvetter/default.aspx</uri></author></entry><entry><title>Graceful Shutdown Azure WebJobs using SDK functions</title><link rel="alternate" type="text/html" href="/blogs/holger_vetter/archive/2017/01/31/graceful-shutdown-azure-webjobs-using-sdk-functions.aspx" /><id>/blogs/holger_vetter/archive/2017/01/31/graceful-shutdown-azure-webjobs-using-sdk-functions.aspx</id><published>2017-01-31T16:32:34Z</published><updated>2017-01-31T16:32:34Z</updated><content type="html">&lt;p&gt;When writing Microsoft Azure WebJobs maybe you ask yourself how to detect that the App Service hosting your webjob is shutting down.
&lt;/p&gt;&lt;p&gt;Earlier you would do something like this: &lt;a href="http://blog.amitapple.com/post/2014/05/webjobs-graceful-shutdown/"&gt;http://blog.amitapple.com/post/2014/05/webjobs-graceful-shutdown/&lt;/a&gt;&lt;br /&gt;As stated there you could create a FileWatcher on the file returned by &amp;quot;&lt;span style="background-color:aqua;"&gt;Environment.GetEnvironmentVariable(&amp;quot;WEBJOBS_SHUTDOWN_FILE&amp;quot;)&lt;/span&gt;&amp;quot; and then check if file exists. This would indicate that the site is going to stop in X seconds.
&lt;/p&gt;&lt;p&gt;But kindly the Azure WebJobs SDK team created a class which does the job for you. It is called &lt;span style="background-color:aqua;"&gt;WebJobsShutdownWatcher&lt;/span&gt; (&lt;a href="https://github.com/Azure/azure-webjobs-sdk/blob/master/src/Microsoft.Azure.WebJobs.Host/WebjobsShutdownWatcher.cs"&gt;https://github.com/Azure/azure-webjobs-sdk/blob/master/src/Microsoft.Azure.WebJobs.Host/WebjobsShutdownWatcher.cs&lt;/a&gt;). &lt;br /&gt;Now you just need to instantiate this class and use the CancellationToken (.Token) for this task.
&lt;/p&gt;&lt;p&gt;Here is a simple example of how you could do this:
&lt;/p&gt;&lt;div&gt;&lt;table style="border-collapse:collapse;"&gt;&lt;tr&gt;&lt;td style="padding-left:7px;padding-right:7px;border-top:solid 0.5pt;border-left:solid 0.5pt;border-bottom:solid 0.5pt;border-right:solid 0.5pt;"&gt;&lt;p&gt;&lt;span style="color:blue;font-family:Consolas;font-size:9pt;"&gt;        static&lt;span style="color:black;"&gt;
									&lt;span style="color:blue;"&gt;void&lt;span style="color:black;"&gt; Main()
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;        {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;
								&lt;span style="color:blue;"&gt;var&lt;span style="color:black;"&gt; config = &lt;span style="color:blue;"&gt;new&lt;span style="color:black;"&gt;
												&lt;span style="color:#2b91af;"&gt;JobHostConfiguration&lt;span style="color:black;"&gt;();
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;
								&lt;span style="color:blue;"&gt;if&lt;span style="color:black;"&gt; (config.IsDevelopment)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;            {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;                config.UseDevelopmentSettings();
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;            }
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;
								&lt;span style="color:#2b91af;"&gt;WebJobsShutdownWatcher&lt;span style="color:black;"&gt; watcher = &lt;span style="color:blue;"&gt;new&lt;span style="color:black;"&gt;
												&lt;span style="color:#2b91af;"&gt;WebJobsShutdownWatcher&lt;span style="color:black;"&gt;();
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;
								&lt;span style="color:#2b91af;"&gt;Task&lt;span style="color:black;"&gt;.Run(() =&amp;gt; {
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;
								&lt;span style="color:blue;"&gt;bool&lt;span style="color:black;"&gt; isCanceled = &lt;span style="color:blue;"&gt;false&lt;span style="color:black;"&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;
								&lt;span style="color:blue;"&gt;while&lt;span style="color:black;"&gt; (!isCanceled)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;                {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;
								&lt;span style="color:blue;"&gt;if&lt;span style="color:black;"&gt; (watcher.Token.IsCancellationRequested)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;                    {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;
								&lt;span style="color:green;"&gt;// do cleanup/cancel code here&lt;span style="color:black;"&gt;
									&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;
								&lt;span style="color:#2b91af;"&gt;Console&lt;span style="color:black;"&gt;.WriteLine(&lt;span style="color:#a31515;"&gt;&amp;quot;CancellationRequested!&amp;quot;&lt;span style="color:black;"&gt;);
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;                        isCanceled = &lt;span style="color:blue;"&gt;true&lt;span style="color:black;"&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;                    }
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;                }
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;            }, watcher.Token).Wait();
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;
								&lt;span style="color:#2b91af;"&gt;Console&lt;span style="color:black;"&gt;.WriteLine(&lt;span style="color:#a31515;"&gt;&amp;quot;Task cancelled, because of                   WebJobsShutdownWatcher.Token!&amp;quot;&lt;span style="color:black;"&gt;);
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;        }&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;p&gt;This will result in the following output in the Azure WebJob Logs:
&lt;/p&gt;&lt;div&gt;&lt;table style="border-collapse:collapse;"&gt;&lt;tr&gt;&lt;td style="padding-left:7px;padding-right:7px;border-top:solid 0.5pt;border-left:solid 0.5pt;border-bottom:solid 0.5pt;border-right:solid 0.5pt;"&gt;&lt;p&gt;[01/31/2017 16:12:35 &amp;gt; 6daba8: SYS INFO] WebJob is stopping due to website shutting down
&lt;/p&gt;&lt;p&gt;[01/31/2017 16:12:35 &amp;gt; 6daba8: SYS INFO] Status changed to Stopping
&lt;/p&gt;&lt;p&gt;&lt;span style="background-color:yellow;"&gt;[01/31/2017 16:12:35 &amp;gt; 6daba8: INFO] CancellationRequested!
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="background-color:yellow;"&gt;[01/31/2017 16:12:35 &amp;gt; 6daba8: INFO] Task cancelled, because of WebJobsShutdownWatcher.Token!&lt;/span&gt;
						&lt;/p&gt;&lt;p&gt; [01/31/2017 16:12:35 &amp;gt; 6daba8: SYS INFO] Status changed to Stopped&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1805623" width="1" height="1"&gt;</content><author><name>hvetter</name><uri>http://developers.de/members/hvetter/default.aspx</uri></author><category term=".NET" scheme="http://developers.de/blogs/holger_vetter/archive/tags/.NET/default.aspx"></category><category term="Microsoft Azure" scheme="http://developers.de/blogs/holger_vetter/archive/tags/Microsoft+Azure/default.aspx"></category></entry><entry><title>VSO azure deployment - Unable to retrieve connectiondetails</title><link rel="alternate" type="text/html" href="/blogs/holger_vetter/archive/2016/12/12/vso-azure-deployment-unable-to-retrieve-connectiondetails.aspx" /><id>/blogs/holger_vetter/archive/2016/12/12/vso-azure-deployment-unable-to-retrieve-connectiondetails.aspx</id><published>2016-12-12T16:16:00Z</published><updated>2016-12-12T16:16:00Z</updated><content type="html">&lt;p&gt;When deploying your application via visual studio online build process and using the &amp;quot;Azure App Service Deploy&amp;quot; build step, make sure the App Service you want to deploy to exists. Otherwise create it with the &amp;quot;Azure Resource Group Deployment&amp;quot; build step.
&lt;/p&gt;
&lt;p&gt;In this build step, you should have a template file for creating the App Service and the App Service Plan.&lt;/p&gt;
&lt;p&gt;Otherwise the deployment will fail with the following error:
&lt;/p&gt;
&lt;p&gt;##[error]Webapp &amp;#39;XXXNameXXX&amp;#39; doesn&amp;#39;t exist. Webapp should exist before deployment.
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is a good error message and we know how to fix this.&lt;/p&gt;
&lt;p&gt;BUT when deploying your application to a staging slot and the App Service doesn&amp;#39;t exist you will get this error:
&lt;/p&gt;
&lt;p&gt;&lt;span style="color:red;"&gt;Not Found
&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:red;"&gt;Unable to retrieve connectiondetails for azureRM WebApp : Ews-TranslatorAPI. Status Code: 404 (Not Found)
&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/121216_5F00_1616_5F00_VSOazuredep2.png" alt="" /&gt;
	&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Both messages mean the same: The App Service you are trying to deploy doesn&amp;#39;t exists.
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1803666" width="1" height="1"&gt;</content><author><name>hvetter</name><uri>http://developers.de/members/hvetter/default.aspx</uri></author></entry><entry><title>Identify ASP.Net Core startup errors</title><link rel="alternate" type="text/html" href="/blogs/holger_vetter/archive/2016/11/30/identify-asp-net-core-startup-errors.aspx" /><id>/blogs/holger_vetter/archive/2016/11/30/identify-asp-net-core-startup-errors.aspx</id><published>2016-11-30T15:31:00Z</published><updated>2016-11-30T15:31:00Z</updated><content type="html">&lt;p&gt;Maybe you know this great and informative error message &amp;quot;An error occurred while starting the application.&amp;quot; from asp.net core when there was an exception during the startup.
&lt;/p&gt;
&lt;p&gt;&lt;img src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/113016_5F00_1531_5F00_IdentifyASP1.png" alt="" /&gt;
	&lt;/p&gt;
&lt;p&gt;To identify and understand what happened, you must extend the Main method with the following things:
&lt;/p&gt;
&lt;p&gt;&lt;img src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/113016_5F00_1531_5F00_IdentifyASP2.png" alt="" /&gt;
	&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;UseSetting(&amp;quot;detailedErrors&amp;quot;, &amp;quot;true&amp;quot;)
&lt;/li&gt;
&lt;li&gt;CaptureStartupErrors(true)
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After this is done, you will see a nice and detailed error page like this:
&lt;/p&gt;
&lt;p&gt;&lt;img src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/113016_5F00_1531_5F00_IdentifyASP3.png" alt="" /&gt;
	&lt;/p&gt;
&lt;p&gt;In my case the startup error was a missing json file which the application tried to load on startup.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1803047" width="1" height="1"&gt;</content><author><name>hvetter</name><uri>http://developers.de/members/hvetter/default.aspx</uri></author><category term="ASP.NET" scheme="http://developers.de/blogs/holger_vetter/archive/tags/ASP.NET/default.aspx"></category><category term="Core.Net" scheme="http://developers.de/blogs/holger_vetter/archive/tags/Core.Net/default.aspx"></category></entry><entry><title>How to identify Swagger errors</title><link rel="alternate" type="text/html" href="/blogs/holger_vetter/archive/2016/11/18/how-to-identify-swagger-errors.aspx" /><id>/blogs/holger_vetter/archive/2016/11/18/how-to-identify-swagger-errors.aspx</id><published>2016-11-18T13:40:39Z</published><updated>2016-11-18T13:40:39Z</updated><content type="html">&lt;p&gt;Last week I had the problem that Swagger wasn&amp;#39;t working.&lt;br /&gt;It just showed an HttpStatusCode 500 and in Visual Studio there wasn&amp;#39;t any exception.&lt;br /&gt;&lt;img src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/111816_5F00_1341_5F00_Howtoidenti1.png" alt="" /&gt;
	&lt;/p&gt;&lt;p&gt;To identify the error I had to activate the &amp;#39;DeveloperExceptionPage&amp;#39; in the Configure method.
&lt;/p&gt;&lt;div&gt;&lt;table style="border-collapse:collapse;"&gt;&lt;tr&gt;&lt;td style="padding-left:7px;padding-right:7px;border-top:solid 0.5pt;border-left:solid 0.5pt;border-bottom:solid 0.5pt;border-right:solid 0.5pt;"&gt;&lt;p&gt;&lt;span style="color:blue;font-family:Consolas;font-size:9pt;"&gt;public&lt;span style="color:black;"&gt;
									&lt;span style="color:blue;"&gt;void&lt;span style="color:black;"&gt; Configure(&lt;span style="color:#2b91af;"&gt;IApplicationBuilder&lt;span style="color:black;"&gt; app, &lt;span style="color:#2b91af;"&gt;IHostingEnvironment&lt;span style="color:black;"&gt; env, &lt;span style="color:#2b91af;"&gt;ILoggerFactory&lt;span style="color:black;"&gt; loggerFactory)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;        {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;            app.UseDeveloperExceptionPage();
&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;p&gt;After this was activated, it showed me this nice error page with some great informations about the problem :)
&lt;/p&gt;&lt;p&gt;&lt;img src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/111816_5F00_1341_5F00_Howtoidenti2.png" alt="" /&gt;&lt;span style="color:black;font-family:Consolas;font-size:9pt;"&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;"&gt;In my case the error was simple to fix, just had two controller operations with same route and same HttpMethod.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1802572" width="1" height="1"&gt;</content><author><name>hvetter</name><uri>http://developers.de/members/hvetter/default.aspx</uri></author></entry><entry><title>ASP.NET Core returns StatusCode:500</title><link rel="alternate" type="text/html" href="/blogs/holger_vetter/archive/2016/11/10/asp-net-core-returns-statuscode-500.aspx" /><id>/blogs/holger_vetter/archive/2016/11/10/asp-net-core-returns-statuscode-500.aspx</id><published>2016-11-10T12:56:24Z</published><updated>2016-11-10T12:56:24Z</updated><content type="html">&lt;p&gt;I ported an MVC WEB API project to ASP.NET Core and now the Service just returned StatusCode: 500 every time I called it.
&lt;/p&gt;&lt;p&gt;Visual Studio doesn&amp;#39;t give me any information or Exception to indicate what happened. 
&lt;/p&gt;&lt;p&gt;To find the error I disabled &amp;quot;Enable just my Code&amp;quot; in the visual studio settings.
&lt;/p&gt;&lt;p&gt;&lt;img src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/111016_5F00_1328_5F00_ASPNETCorer1.png" alt="" /&gt;
	&lt;/p&gt;&lt;p&gt;Now the visual studio showed this exception from the framework, when I call the service:&lt;br /&gt;&amp;quot;Multiple constructors accepting all given argument types have been found in type &amp;quot;…&amp;quot;. There should only be one applicable constructor&amp;quot;.
&lt;/p&gt;&lt;p&gt;&lt;img src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/111016_5F00_1328_5F00_ASPNETCorer2.png" alt="" /&gt;
	&lt;/p&gt;&lt;p&gt;&lt;img src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/111016_5F00_1328_5F00_ASPNETCorer3.png" alt="" /&gt;
	&lt;/p&gt;&lt;p&gt;This error indicates that we have multiple constructors, which accepts same argument types. But this wasn&amp;#39;t the case, I just removed the empty constructor and it worked fine.
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;img src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/111016_5F00_1328_5F00_ASPNETCorer4.png" alt="" /&gt;
	&lt;/p&gt;&lt;p&gt;One was the empty constructor I had before in my ASP.NET WEB API application and the other one was for ASP.NET Core.&lt;br /&gt;I just removed the empty one and it worked fine &lt;span style="font-family:Wingdings;"&gt;J&lt;/span&gt;
	&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;Recap: Don&amp;#39;t use multiple constructors when injection IOptions.
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1802216" width="1" height="1"&gt;</content><author><name>hvetter</name><uri>http://developers.de/members/hvetter/default.aspx</uri></author><category term="ASP.NET" scheme="http://developers.de/blogs/holger_vetter/archive/tags/ASP.NET/default.aspx"></category><category term="Core.Net" scheme="http://developers.de/blogs/holger_vetter/archive/tags/Core.Net/default.aspx"></category></entry><entry><title>.NET Core json settings and environment variable</title><link rel="alternate" type="text/html" href="/blogs/holger_vetter/archive/2016/10/19/net-core-json-settings-and-environment-variable.aspx" /><id>/blogs/holger_vetter/archive/2016/10/19/net-core-json-settings-and-environment-variable.aspx</id><published>2016-10-19T15:19:52Z</published><updated>2016-10-19T15:19:52Z</updated><content type="html">&lt;p&gt;Today we deployed .NET Core application on a test machine and then configured the application as environmental variable in the system.
&lt;/p&gt;&lt;p&gt;When we started the command line application, it couldn&amp;#39;t find &amp;#39;settings.json&amp;#39; file for reading the configuration.
&lt;/p&gt;&lt;p&gt;This happens because the application looks for it on the relative path where the command was executed.&lt;br /&gt;For example application is in C:\Temp\tool.exe and you run enter &amp;#39;tool&amp;#39; while in &amp;#39;C:\Users\hvetter&amp;#39;, the application will start but will not found your settings file because it searches it in &amp;#39;C:\Users\hvetter&amp;#39; folder instead of &amp;#39;C:\Temp\&amp;#39;.&lt;br /&gt;&lt;img src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/101916_5F00_1524_5F00_NETCorejson1.png" alt="" /&gt;
	&lt;/p&gt;&lt;p&gt;This is the code we used to load the settings file and the output in the Commandline.
&lt;/p&gt;&lt;p&gt;SETTINGS_FILE_NAME is a constant and equals &amp;#39;settings.json&amp;#39;.
&lt;/p&gt;&lt;p&gt;&lt;img src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/101916_5F00_1524_5F00_NETCorejson2.png" alt="" /&gt;
	&lt;/p&gt;&lt;p&gt;It searched &amp;#39;settings.json&amp;#39; file in relative wrong folder.
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;I changed the code to this for testing and added the output to show what happened.&lt;br /&gt;&lt;img src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/101916_5F00_1524_5F00_NETCorejson3.png" alt="" /&gt;
	&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;strong&gt;Recap: Don&amp;#39;t use relative paths in .Net Core for loading your settings :)&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1800873" width="1" height="1"&gt;</content><author><name>hvetter</name><uri>http://developers.de/members/hvetter/default.aspx</uri></author><category term="Core.Net" scheme="http://developers.de/blogs/holger_vetter/archive/tags/Core.Net/default.aspx"></category></entry><entry><title>ASP.NET MVC WEB API Impersonation Thread issue</title><link rel="alternate" type="text/html" href="/blogs/holger_vetter/archive/2016/09/20/asp-net-mvc-web-api-impersonation-thread-issue.aspx" /><id>/blogs/holger_vetter/archive/2016/09/20/asp-net-mvc-web-api-impersonation-thread-issue.aspx</id><published>2016-09-20T14:53:00Z</published><updated>2016-09-20T14:53:00Z</updated><content type="html">&lt;p&gt;In an ASP.NET MVC WEB API application I implemented Windows Authentication with custom roles by using an implementation of IIdentity.   &lt;br /&gt;In my setup the user gets authenticated by NTLM, then we have the user name. Now there is a part in the OWIN Pipeline which gets the roles for this user and caches them.&lt;/p&gt;
&lt;p&gt;When the user sends a request to the server it will go trough the &amp;ldquo;Application_OnPostAuthenticateRequest&amp;ldquo;method in the Global.asax.cs, this method will then get the User from the current thread (which is the authenticated user) and then create a new object of our custom implementation of IIdentity. After this we map some things like the UserName and get the correct roles for this user and append them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;The important part in the &amp;ldquo;Application_OnPostAuthenticateRequest&amp;rdquo; method is to set the modified Thread.CurrentPrincipal back to the HttpContext.Current.User. If you don&amp;rsquo;t do this, you possible lose our custom Identity object next time ASP.NET maps/sets the HttpContext.Current.User&amp;nbsp;to Thread.CurrentPrincipal (Thread.CurrentPrincipal gets overriden by HttpContext.Current.User).&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In my tests the ManagedThreadId in OnPostRequest method and the actual service operations where different, but not everytime. When I attach a debugger it worked. This leaded me to a threading problem. In the OnPostRequest method I set the Thread.CurrentUser and in my service operation I was in a different thread, that&amp;rsquo;s why the custom roles disappeared.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Maybe you have the some problem and this helps you :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1798852" width="1" height="1"&gt;</content><author><name>hvetter</name><uri>http://developers.de/members/hvetter/default.aspx</uri></author><category term=".NET" scheme="http://developers.de/blogs/holger_vetter/archive/tags/.NET/default.aspx"></category><category term="ASP.NET" scheme="http://developers.de/blogs/holger_vetter/archive/tags/ASP.NET/default.aspx"></category><category term="WEB API" scheme="http://developers.de/blogs/holger_vetter/archive/tags/WEB+API/default.aspx"></category></entry><entry><title>Host plain HTML/Javascript page in Web Part (angular/bootstrap)</title><link rel="alternate" type="text/html" href="/blogs/holger_vetter/archive/2016/06/17/host-plain-html-javascript-page-in-web-part-angular-bootstrap.aspx" /><id>/blogs/holger_vetter/archive/2016/06/17/host-plain-html-javascript-page-in-web-part-angular-bootstrap.aspx</id><published>2016-06-17T15:17:12Z</published><updated>2016-06-17T15:17:12Z</updated><content type="html">&lt;p&gt;Today I implemented an example web application using bootstrap/angular which should perform basic CRUD operations on Sharepoint 2010 Lists with rest api.&lt;/p&gt;  &lt;p&gt;You can host your complete bootstrap/angular web application in sharepoint and display it in a web part.   &lt;br /&gt;To archieve this, first create or use a document library and upload your html/javascript/css files. You have to rename all your .html files to .aspx, because per default sharepoint only shows .aspx files in browsers. When you try to open an .html file from a document library the browser not show it, instead he asks you to download.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/image_5F00_7E44535A.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="image" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/image_5F00_thumb_5F00_3A03EC0E.png" width="755" height="154" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;After you uploaded your files to a document library you have to create a page.   &lt;br /&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/image_5F00_00ED0F0C.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;display:inline;padding-right:0px;" border="0" alt="image" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/image_5F00_thumb_5F00_32E4AF96.png" width="244" height="179" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Page should open automaticly in edit mode after creation. Now click on the “Insert”Ribbon and pick web part. Navigate to “Media and Content” and select the “Page Viewer”. It will host your code in an iframe.   &lt;br /&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/image_5F00_79CDD293.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;display:inline;padding-right:0px;" border="0" alt="image" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/image_5F00_thumb_5F00_40B6F591.png" width="244" height="158" /&gt;&lt;/a&gt;    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Edit the web part and enter the url to your main/start file (.aspx file) of your web application. Save everything and you are done. If needed modify the height or other properties of the web part to fit your needs.&lt;/p&gt;  &lt;p&gt;The result for me looks like this:   &lt;br /&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/image_5F00_72AE961B.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="image" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/image_5F00_thumb_5F00_3997B919.png" width="376" height="492" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1792359" width="1" height="1"&gt;</content><author><name>hvetter</name><uri>http://developers.de/members/hvetter/default.aspx</uri></author><category term="sharepoint" scheme="http://developers.de/blogs/holger_vetter/archive/tags/sharepoint/default.aspx"></category><category term="javascript" scheme="http://developers.de/blogs/holger_vetter/archive/tags/javascript/default.aspx"></category><category term="angular" scheme="http://developers.de/blogs/holger_vetter/archive/tags/angular/default.aspx"></category><category term="html" scheme="http://developers.de/blogs/holger_vetter/archive/tags/html/default.aspx"></category><category term="sharepoint 2010" scheme="http://developers.de/blogs/holger_vetter/archive/tags/sharepoint+2010/default.aspx"></category><category term="bootstrap" scheme="http://developers.de/blogs/holger_vetter/archive/tags/bootstrap/default.aspx"></category></entry><entry><title>Create InfoPath file from manifest without tool</title><link rel="alternate" type="text/html" href="/blogs/holger_vetter/archive/2016/05/23/create-infopath-file-from-manifest-without-tool.aspx" /><id>/blogs/holger_vetter/archive/2016/05/23/create-infopath-file-from-manifest-without-tool.aspx</id><published>2016-05-23T11:22:55Z</published><updated>2016-05-23T11:22:55Z</updated><content type="html">&lt;p&gt;Hello,   &lt;br /&gt;last year I blogged about building an InfoPath files from before extracted manifest file (&lt;a title="http://developers.de/blogs/holger_vetter/archive/2015/07/16/cabfilepacker-for-creating-infopath-cab-files.aspx" href="http://developers.de/blogs/holger_vetter/archive/2015/07/16/cabfilepacker-for-creating-infopath-cab-files.aspx"&gt;http://developers.de/blogs/holger_vetter/archive/2015/07/16/cabfilepacker-for-creating-infopath-cab-files.aspx&lt;/a&gt;).&lt;/p&gt;  &lt;p&gt;But there is a different and easier way to repack the extracted .xsn file.   &lt;br /&gt;Just open the manifest.xsf file with InfoPath Designer, click “Save as” and then pick “.xsn file”. This will save your form as a packed InfoPath file.&lt;/p&gt;  &lt;p&gt;No need to use tools for packing files into a .cab file.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1789841" width="1" height="1"&gt;</content><author><name>hvetter</name><uri>http://developers.de/members/hvetter/default.aspx</uri></author></entry><entry><title>Hyper-V another user connected to virtual machine</title><link rel="alternate" type="text/html" href="/blogs/holger_vetter/archive/2016/05/17/hyper-v-another-user-connected-to-virtual-machine.aspx" /><id>/blogs/holger_vetter/archive/2016/05/17/hyper-v-another-user-connected-to-virtual-machine.aspx</id><published>2016-05-17T08:23:06Z</published><updated>2016-05-17T08:23:06Z</updated><content type="html">&lt;p&gt;Hello,   &lt;br /&gt;I created a new Hyper-V machine and installed Windows 10 Pro on it. After installation I created a default user with no password, for faster login.&lt;/p&gt;  &lt;p&gt;When you start the machine and connect to it, windows will automatically login with this user, because it has no password. But then you will lose the connection with following error: &amp;quot;The connection was lost because another user connected to the virtual machine. Try to connect again. If the problem persists, contact your system administrator.&amp;quot;&lt;/p&gt;  &lt;p&gt;This happens because of the Hyper-V Enhanced Mode, which you can disable here;   &lt;br /&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/image_5F00_2A7EDB48.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;display:inline;padding-right:0px;" border="0" alt="image" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/image_5F00_thumb_5F00_514CF188.png" width="244" height="48" /&gt;&lt;/a&gt;    &lt;br /&gt;Hyper-V Enhanced Mode is based on RDP (Remote Desktop Protocol). Remote desktop connections by default, including Hyper-V Enhanced Mode connections only work with accounts that have a password set. &lt;/p&gt;  &lt;p&gt;If you don’t want to use a password for your Hyper-V machine, you have to have use the Basic Virtual machine connection.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1789073" width="1" height="1"&gt;</content><author><name>hvetter</name><uri>http://developers.de/members/hvetter/default.aspx</uri></author></entry><entry><title>Window resize event in angular</title><link rel="alternate" type="text/html" href="/blogs/holger_vetter/archive/2016/04/28/window-resize-event-in-angular.aspx" /><id>/blogs/holger_vetter/archive/2016/04/28/window-resize-event-in-angular.aspx</id><published>2016-04-28T09:20:39Z</published><updated>2016-04-28T09:20:39Z</updated><content type="html">&lt;p&gt;Hello,&lt;/p&gt;  &lt;p&gt;in my case I had a svg element which scales with window size and I needed that the displayed numbers on the image are changing depending on the window of the svg element.    &lt;br /&gt;To archieve this I had to subscribe to the window resize event with angular.&lt;/p&gt;  &lt;p&gt;First you have to add a dependency to $window.   &lt;br /&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/image_5F00_378EF832.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="image" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/image_5F00_thumb_5F00_45613E2D.png" width="699" height="65" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;After this you should create a variable with the JQuery object.   &lt;br /&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/image_5F00_25463170.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="image" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/image_5F00_thumb_5F00_6C2F546D.png" width="474" height="69" /&gt;&lt;/a&gt;    &lt;br /&gt;And then bind a function to the resize event.    &lt;br /&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/image_5F00_3318776B.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="image" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/holger_5F00_vetter/image_5F00_thumb_5F00_4C1447B0.png" width="524" height="112" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In my case, every time the window resizes it will call the buildGraphYTexts. This method will then get the actual height of the graph and calculate new numbers for the Y Axis.&lt;/p&gt;  &lt;p&gt;Happy coding :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1785648" width="1" height="1"&gt;</content><author><name>hvetter</name><uri>http://developers.de/members/hvetter/default.aspx</uri></author></entry></feed>