Starcounter / Starcounter.VisualStudio

Starcounter Visual Studio development support
0 stars 0 forks source link

Added a new Starcounter Template #4

Closed threezool closed 7 years ago

threezool commented 7 years ago

The template contains boilerplate code for a new Starcounter app with the folder structure and basic handlers and viewmodels in place.

per-samuelsson commented 7 years ago

@threezool

Thanks for contributing!

@warpech @miyconst

Can you guys take a look at this too, from the app dev side? You would know better if this is something we are missing and/or if there are already plans for something similar. @Mackiovello is already busy reviewing the actual code, and I can take on me to review the technical aspects (i.e. the actual project settings, etc).

per-samuelsson commented 7 years ago

@threezool

You request to merge this into develop, meaning 2.4. Note that we currently have a non-compatible leap 2.3 -> 2.4, meaning projects should be configured differently for each target.

The project template you provide is compatible with 2.3, but not 2.4. So either this merge should go into v2.3, or you should adapt to 2.4, i.e. develop branch.

Details are here: https://github.com/Starcounter/Starcounter.VisualStudio/wiki/Version-compatibility#how-do-i-migrate-a-project-from-21-3--24-or-vice-versa

threezool commented 7 years ago

@per-samuelsson

Since its already in 2.3 we can start there and after it gets merged i could adapt it for 2.4. I'm guessing that 2.3 resides in the master branch instead of the develop branch?

per-samuelsson commented 7 years ago

I'm guessing that 2.3 resides in the master branch instead of the develop branch?

In Starcounter.VisualStudio repo, yes. It's described here and can be used together with this for the full chart.

warpech commented 7 years ago

Implements: https://github.com/Starcounter/Starcounter/issues/4114

per-samuelsson commented 7 years ago

Implements: Starcounter/Starcounter#4114

The let's invite @jwillmer and ask for his review if he can find the time.

jwillmer commented 7 years ago

How can I test it? Do you have a vsix file for me or is it already integrated in a nightly starcounter build?

threezool commented 7 years ago

@jwillmer

jwillmer commented 7 years ago

Sounds really time consuming. Let me give you feedback as soon as you have worked out how to ship it to the end user.

threezool commented 7 years ago

@jwillmer

I made a .vsix file for the template and it should work, first time i had to make one. The template should now also be under the Starcounter node with this installer.

StarcounterExtendedTemplates.zip

jwillmer commented 7 years ago

image

I have (only) VisualStudio 2015 on this machine.

threezool commented 7 years ago

Yah i just noticed that its limited to VS 2017 atm, looking in to making it compatible for VS 2015 also.

jwillmer commented 7 years ago

Try to give the VSIX a good name already since it is used to auto update and don't forget to always increase the version number after changes so that all systems will recognize it as an update.

threezool commented 7 years ago

There, figured out how to set the appropriate version for the vsix installer.

StarcounterExtendedTemplates.zip

jwillmer commented 7 years ago

VisualStudio 2015: image

<entry>
    <record>613</record>
    <time>2017/03/21 16:24:35.691</time>
    <type>Error</type>
    <source>Editor or Editor Extension</source>
    <description>Microsoft.VisualStudio.ExtensibilityHosting.InvalidMEFCacheException: The Visual Studio component cache is out of date. Please restart Visual Studio.&#x000D;&#x000A;   at Microsoft.VisualStudio.ExtensibilityHosting.FaultCatchingAssemblyLoader.&lt;LoadAssembly&gt;b__15_0(AssemblyName assemblyNameParam)&#x000D;&#x000A;   at Microsoft.VisualStudio.ExtensibilityHosting.Utilities.SafeGetOrAdd[TKey,TValue](IDictionary`2 dictionary, TKey key, Object lockObj, Func`2 valueFactory)&#x000D;&#x000A;   at Microsoft.VisualStudio.ExtensibilityHosting.FaultCatchingAssemblyLoader.LoadAssembly(AssemblyName assemblyName)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.Reflection.TypeRef.get_ResolvedType()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.LazyMetadataWrapper.Enum32Substitution.get_ActualValue()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.LazyMetadataWrapper.SubstituteValueIfRequired(Object value)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.LazyMetadataWrapper.SubstituteValueIfRequired(String key, Object value)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.LazyMetadataWrapper.TryGetValue(String key, Object&amp; value)&#x000D;&#x000A;   at _proxy_Microsoft.VisualStudio.Text.Utilities.IWpfTextViewMarginMetadata_7e5c586b-2c09-40d6-893a-63049b022746.get_GridUnitType()&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Utilities.ContainerMargin.AddMargin(IWpfTextViewMargin margin, Lazy`2 marginProvider, Boolean trackVisibility)&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Utilities.ContainerMargin.AddMargins(IList`1 providers, List`1 oldMargins)&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Utilities.ContainerMargin.Initialize()&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Editor.Implementation.RightControlMarginProvider.CreateMargin(IWpfTextViewHost wpfTextViewHost, IWpfTextViewMargin marginContainer)&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Utilities.ContainerMargin.&lt;AddMargins&gt;b__25_1(IWpfTextViewMarginProvider mp)&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy`2 provider, Func`2 getter)</description>
  </entry>

Second start of VisualStudio worked without this error.

jwillmer commented 7 years ago

File Structure: image

Comments:

If I browse to http://localhost:8080/StarcounterApplication1 I get:

System.ArgumentOutOfRangeException: Das angegebene Argument liegt außerhalb des gültigen Wertebereichs.
Parametername: Can not find referenced Html file: "/StarcounterApplication1/viewmodels/MainPage.html"
   bei Starcounter.HtmlFromJsonProvider.ProvideFromFilePath[T](String filePath) in C:\TeamCity\BuildAgent\work\sc-2824\Level1\src\Starcounter\Middleware\HtmlFromJsonProvider.cs:Zeile 58.
   bei Starcounter.HtmlFromJsonProvider.Invoke(MimeProviderContext context, Action next) in C:\TeamCity\BuildAgent\work\sc-2824\Level1\src\Starcounter\Middleware\HtmlFromJsonProvider.cs:Zeile 53.
   bei Starcounter.Internal.JsonMimeConverter.Convert(Request request, IResource before, MimeType mimeType, MimeType& resultingMimeType) in C:\TeamCity\BuildAgent\work\sc-2824\Level1\src\Starcounter.Apps.JsonPatch\BuiltInRestHandlers\JsonMimeConverter.cs:Zeile 18.
   bei Starcounter.Json.AsMimeType(MimeType mimeType, MimeType& resultingMimeType, Request request) in C:\TeamCity\BuildAgent\work\sc-2824\Level1\src\Starcounter.XSON\Class Json\Json.IResource.cs:Zeile 43.
   bei Starcounter.Response.ConstructFromFields(Request req, Byte[] givenBuffer) in C:\TeamCity\BuildAgent\work\sc-2824\Level1\src\Starcounter.Internal\Http\Response.cs:Zeile 809.
   bei Starcounter.Request.SendResponse(Response resp, Byte[] serializationBuf) in C:\TeamCity\BuildAgent\work\sc-2824\Level1\src\Starcounter.Internal\Http\Request.cs:Zeile 1241.
   bei Starcounter.Internal.AppsBootstrapper.ProcessExternalRequest(Request req) in C:\TeamCity\BuildAgent\work\sc-2824\Level1\src\Starcounter.Apps.JsonPatch\AppsBootstrapper.cs:Zeile 811.
ParamName=Can not find referenced Html file: "/StarcounterApplication1/viewmodels/MainPage.html"
HResult=-2146233086

More information about this error may be available in the server error log.
per-samuelsson commented 7 years ago

It is especially a problem in the beginning to think about the Copy Local: false flag

FWIW, this is changed in 2.4. There, we are switching to other private assemblies (i.e. Copy local: true), which is the default for standard projects.

warpech commented 7 years ago

Ping @threezool. This was a good initiative. Where are we on this?

threezool commented 7 years ago

Have had some other things to do but it is not forgotten. Just need to find the time.

warpech commented 7 years ago

Let's not have so much work laying on the floor. Maybe it is best to merge as it is and split @jwillmer's comments (most, if not all, of which are valid) into separate issues?

threezool commented 7 years ago

Its ok with me, i can transfer over the points in to separate issues to be worked on. It would also be easier to find the time if they are split.

rotnot commented 7 years ago

This PR is was not updated in a while. Please consider speeding up the review, splitting the changes into smaller tasks or anything else that makes it easier to decide about merging before it starts to smell.

threezool commented 7 years ago

Merging and will add the points from @jwillmer as issues instead.