# Problems with my first Code First .NET service

**URL:** https://talk.remobjects.com/t/problems-with-my-first-code-first-net-service/24538
**Category:** Remoting SDK
**Tags:** visual-studio, oxygene
**Created:** [April 7, 2021, 3:39pm UTC](https://talk.remobjects.com/t/problems-with-my-first-code-first-net-service/24538 "2021-04-07T15:39:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![aolson](https://talk.remobjects.com/user_avatar/talk.remobjects.com/aolson/32/11707_2.png) [@aolson](https://talk.remobjects.com/u/aolson)
#### Post date: [April 7, 2021, 3:39pm UTC](https://talk.remobjects.com/t/problems-with-my-first-code-first-net-service/24538/1 "2021-04-07T15:39:58Z")

</div>

Using latest VS 2019 Communite, latest ROSDK and latest Elements beta…

I wrote a new .NET service and decided to finally try code-first. I configured it, wrote it, it compiles fine and installs properly as a Windows service. I can access it in my client and get the RODL and Intf files fine so my client can properly compile.

Problems is when i run my client and try any Service method, i get the following:

```
RemObjects.SDK.Exceptions.SessionNotFoundException
An exception occurred on the server: Session could not be found.

```

What is causing this? I didn’t modify the NetworkServer.SessionManager at all, just used the default. Do i need to do anything with this???

---

<div class="post-metadata">

### Author: ![antonk](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@antonk](https://talk.remobjects.com/u/antonk)
#### Post date: [April 7, 2021, 3:57pm UTC](https://talk.remobjects.com/t/problems-with-my-first-code-first-net-service/24538/2 "2021-04-07T15:57:21Z")

</div>

This message means that you have to log in first before attempting to execute any methods of this service.

Apparently your service class has the `ServiceRequiresLogin` attribute applied to it. This attribute means that one HAS to successfully perform login before being able to execute any methods of this service,
