I added the Script # project to my site project and created a small sample library with two classes.
Now I want to use these classes from the website code. In this case, I created a simple tree of objects and serialized it in JSON (which will then receive the client-side code).
I tried to add a link to the Script # project. It compiles fine, but then gives me an error on startup:
Is it even possible to use code between Script # and regular C #?
I am using Script # 0.6 with VS 2010 and .NET 3.5 (both projects).
. , -.
:
public class MyDataPacket { public int UserId; public string SomeData1; public int SomeData2; #if SCRIPTSHARP public MyDataPacket(MyOtherClientSideClass arg) { // init } #endif #if WEBSERVER public MyDataPacket(MyOtherServerSideClass arg) { // init } #endif }
EDIT: Script # SCRIPTSHARP , !WEBSERVER.
SCRIPTSHARP
!WEBSERVER
script # # . VS ( , ). # . , , , . , # #, script # script #.
, , , # script #. , , , .
Script # #?
. # 2.0 Script # . automapper.
Script #, , .
, Script # Javascript.
Source: https://habr.com/ru/post/1755299/More articles:Латекс: заголовки и заголовки разделов с фоном - headermemmem () STL path? - c ++Is there an alternative to DateTime.Ticks or DateTime.TimeOfDay in Linq-To-Entities? - c #Wildly inaccurate GPS position and speed - androidHow to write a makefile for a C ++ project that uses Eigen, a C ++ template library for linear algebra? - c ++Android: automatic update of google maps - androidIgnore hosts file? - c #Customizing the colors of the whole scene - c #Display object from file in java - javais it possible to build an ATL project in VS Express 2010 - c ++All Articles